Skip to content

Commit 577a93e

Browse files
increase polling time for integration test
1 parent b94cd10 commit 577a93e

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOpenTelemetry.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,7 @@ public static Logging createLoggingClient(
206206
}
207207

208208
public static void releaseSdk(OpenTelemetry openTelemetry) {
209-
if (openTelemetry == null
210-
|| openTelemetry == GlobalOpenTelemetry.get()
211-
|| openTelemetry == OpenTelemetry.noop()) {
209+
if (openTelemetry == null || openTelemetry == OpenTelemetry.noop()) {
212210
return;
213211
}
214212

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITOpenTelemetryTest.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,7 @@ private String verifyAndFetchLogs(String connectionUuid) throws Exception {
258258
.setCredentials(credentials)
259259
.build()
260260
.getService()) {
261-
String filter =
262-
"logName:\"projects/"
263-
+ PROJECT_ID
264-
+ "/logs/com.google.cloud.bigquery\" AND labels.\"jdbc.connection_id\"=\""
265-
+ connectionUuid
266-
+ "\"";
261+
String filter = "labels.\"jdbc.connection_id\"=\"" + connectionUuid + "\"";
267262

268263
List<LogEntry> entries = fetchLogsWithRetry(logging, filter);
269264
assertFalse(entries.isEmpty(), "Telemetry logs should be exported to GCP");
@@ -306,8 +301,11 @@ private Trace verifyAndFetchTrace(String traceId) throws Exception {
306301

307302
private <T> T pollWithRetry(java.util.concurrent.Callable<T> task) throws InterruptedException {
308303
int attempts = 0;
309-
int maxAttempts = 20; // 20 attempts * 3000ms = 60 seconds max delay
310-
long delayMs = 3000; // 3000ms linear polling
304+
int maxAttempts = 10;
305+
long delayMs = 10000;
306+
307+
// 10 second wait for GCP to ingest data
308+
Thread.sleep(10000);
311309

312310
while (attempts < maxAttempts) {
313311
attempts++;

0 commit comments

Comments
 (0)