From abc789f57a3ea00b8b0197da6cff137efd3c73ba Mon Sep 17 00:00:00 2001 From: Mike Eltsufin Date: Tue, 21 Apr 2026 16:17:28 -0400 Subject: [PATCH 1/6] build: skip native tests for credentials module The google-auth-library-java migration to the monorepo inadvertently enabled GraalVM native testing for the credentials module because the generic graalvm-single job type runs tests on all modules in the subdirectory. In the original repository, this job was carefully scoped to only test the oauth2_http module. This change adds true to the credentials module POM to skip native tests, resolving the failure when the plugin cannot find test configuration files. Fixes #12859 --- google-auth-library-java/credentials/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/google-auth-library-java/credentials/pom.xml b/google-auth-library-java/credentials/pom.xml index 62cff4c16bb8..7d80fde4a5ac 100644 --- a/google-auth-library-java/credentials/pom.xml +++ b/google-auth-library-java/credentials/pom.xml @@ -22,6 +22,13 @@ java javatests + + org.graalvm.buildtools + native-maven-plugin + + true + + org.apache.maven.plugins maven-source-plugin From acab5578c27c611e04d0f734c46010ab24ae702d Mon Sep 17 00:00:00 2001 From: Mike Eltsufin Date: Tue, 21 Apr 2026 20:35:49 -0400 Subject: [PATCH 2/6] build: activate slf4j2x profile for auth native tests The google-auth-library-oauth2-http module fails to compile in the GraalVM job because the slf4j package is not found. In the original repository, this job was executed with the -Pslf4j2x profile activated, which adds the dependency. This change adds -Pslf4j2x to INTEGRATION_TEST_ARGS in the job configuration file. Fixes #12889 --- .../google-auth-library-java-graalvm-native-presubmit.cfg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.kokoro/presubmit/google-auth-library-java-graalvm-native-presubmit.cfg b/.kokoro/presubmit/google-auth-library-java-graalvm-native-presubmit.cfg index 15cf4809e57e..0cef3c4ff61b 100644 --- a/.kokoro/presubmit/google-auth-library-java-graalvm-native-presubmit.cfg +++ b/.kokoro/presubmit/google-auth-library-java-graalvm-native-presubmit.cfg @@ -50,3 +50,9 @@ env_vars: { key: "BUILD_SUBDIR" value: "google-auth-library-java" } + +env_vars: { + key: "INTEGRATION_TEST_ARGS" + value: "-Pslf4j2x" +} + From 2159229029fece697c2e215060bb096f8a48da71 Mon Sep 17 00:00:00 2001 From: Mike Eltsufin Date: Tue, 21 Apr 2026 21:27:36 -0400 Subject: [PATCH 3/6] test: fix flaky concurrent test in cab token generator The refreshCredentialsIfRequired_asyncMultiThread test was failing because the mock clock was returning a fixed stale time, causing multiple threads to trigger redundant refreshes if they didn't overlap perfectly. This change modifies the mock clock to return a stale time on the first call (to trigger the async refresh) and a fresh time on subsequent calls (to skip redundant refreshes). This fix is isolated to only the ASYNC test case to avoid breaking BLOCKING tests. --- .../ClientSideCredentialAccessBoundaryFactoryTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/google-auth-library-java/cab-token-generator/javatests/com/google/auth/credentialaccessboundary/ClientSideCredentialAccessBoundaryFactoryTest.java b/google-auth-library-java/cab-token-generator/javatests/com/google/auth/credentialaccessboundary/ClientSideCredentialAccessBoundaryFactoryTest.java index bfe9077c990f..6fa67e444922 100644 --- a/google-auth-library-java/cab-token-generator/javatests/com/google/auth/credentialaccessboundary/ClientSideCredentialAccessBoundaryFactoryTest.java +++ b/google-auth-library-java/cab-token-generator/javatests/com/google/auth/credentialaccessboundary/ClientSideCredentialAccessBoundaryFactoryTest.java @@ -614,22 +614,30 @@ private Clock createMockClock(RefreshType refreshType, GoogleCredentials sourceC // Set mocked time so that the token is fresh and no refresh is needed (before the refresh // margin). mockedTimeInMillis = expirationTimeInMillis - refreshMarginInMillis - 60000; + when(mockClock.currentTimeMillis()).thenReturn(mockedTimeInMillis); break; case ASYNC: // Set mocked time so that the token is nearing expiry and an async refresh is triggered // (within the refresh margin). mockedTimeInMillis = expirationTimeInMillis - refreshMarginInMillis + 60000; + when(mockClock.currentTimeMillis()) + .thenReturn( + mockedTimeInMillis, // First call: Stale (triggers the async refresh) + currentTimeInMillis // Subsequent calls: Fresh (skips redundant refreshes) + ); break; case BLOCKING: // Set mocked time so that the token requires immediate refresh (just after the minimum // token lifetime). mockedTimeInMillis = expirationTimeInMillis - minimumTokenLifetimeMillis + 60000; + when(mockClock.currentTimeMillis()).thenReturn(mockedTimeInMillis); break; default: throw new IllegalArgumentException("Unexpected RefreshType: " + refreshType); } - when(mockClock.currentTimeMillis()).thenReturn(mockedTimeInMillis); + + return mockClock; } From 825d8b6716fa948868f77ed38215601a2aba7a35 Mon Sep 17 00:00:00 2001 From: cloud-java-bot Date: Wed, 22 Apr 2026 01:34:18 +0000 Subject: [PATCH 4/6] chore: generate libraries at Wed Apr 22 01:32:44 UTC 2026 --- gapic-libraries-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index 9cbef9e2cdee..5acc011becd1 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -1259,7 +1259,7 @@ com.google.cloud google-cloud-spanner-bom - 6.116.0 + 6.116.1 pom import From 4ee833d919148208106904adf96a5b140d549744 Mon Sep 17 00:00:00 2001 From: Mike Eltsufin Date: Tue, 21 Apr 2026 21:43:44 -0400 Subject: [PATCH 5/6] chore: fix formatting in cab token generator tests chore: fix formatting in cab token generator tests to comply with project style rules. --- .../ClientSideCredentialAccessBoundaryFactoryTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/google-auth-library-java/cab-token-generator/javatests/com/google/auth/credentialaccessboundary/ClientSideCredentialAccessBoundaryFactoryTest.java b/google-auth-library-java/cab-token-generator/javatests/com/google/auth/credentialaccessboundary/ClientSideCredentialAccessBoundaryFactoryTest.java index 6fa67e444922..99cbbbda90f1 100644 --- a/google-auth-library-java/cab-token-generator/javatests/com/google/auth/credentialaccessboundary/ClientSideCredentialAccessBoundaryFactoryTest.java +++ b/google-auth-library-java/cab-token-generator/javatests/com/google/auth/credentialaccessboundary/ClientSideCredentialAccessBoundaryFactoryTest.java @@ -624,7 +624,7 @@ private Clock createMockClock(RefreshType refreshType, GoogleCredentials sourceC .thenReturn( mockedTimeInMillis, // First call: Stale (triggers the async refresh) currentTimeInMillis // Subsequent calls: Fresh (skips redundant refreshes) - ); + ); break; case BLOCKING: // Set mocked time so that the token requires immediate refresh (just after the minimum @@ -636,8 +636,6 @@ private Clock createMockClock(RefreshType refreshType, GoogleCredentials sourceC throw new IllegalArgumentException("Unexpected RefreshType: " + refreshType); } - - return mockClock; } From e8e26f51e659a23ab9283e8f7b89551cc9cad91d Mon Sep 17 00:00:00 2001 From: Mike Eltsufin Date: Wed, 22 Apr 2026 11:19:25 -0400 Subject: [PATCH 6/6] chore: skip GraalVM native tests for AppEngine module The google-auth-library-appengine module was failing the native test phase because it lacked the necessary GraalVM test configuration file. This change skips native tests for this module, consistent with what we did for the credentials module. --- google-auth-library-java/appengine/pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/google-auth-library-java/appengine/pom.xml b/google-auth-library-java/appengine/pom.xml index 0af59fd0d985..77bdd254cc7a 100644 --- a/google-auth-library-java/appengine/pom.xml +++ b/google-auth-library-java/appengine/pom.xml @@ -42,6 +42,14 @@ + + org.graalvm.buildtools + native-maven-plugin + + true + + +