Skip to content

Commit 0e807a9

Browse files
committed
test(compute): document rationale for credential refresh in observability tests
1 parent d1fff49 commit 0e807a9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

java-compute/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ public void setUp() throws Exception {
113113
testRunId = generateRandomHexString(8);
114114

115115
GoogleCredentials credentials = GoogleCredentials.getApplicationDefault();
116+
// We explicitly refresh the credentials here to guarantee a valid token is extracted.
117+
// The standard OTLP exporter does not automatically manage OAuth token lifecycles
118+
// when they are passed as static header strings.
116119
credentials.refreshIfExpired();
117120
String token = credentials.getAccessToken().getTokenValue();
118121

0 commit comments

Comments
 (0)