Skip to content

Commit 1c53451

Browse files
authored
test(datastore): Fix flaky ITE2ETracingTest by handling DeadlineExceededException (#12684)
Fixes #11978
1 parent 914f97f commit 1c53451

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

java-datastore/google-cloud-datastore/src/test/java/com/google/cloud/datastore/it/ITE2ETracingTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import static org.junit.Assert.assertNull;
3838
import static org.junit.Assert.assertTrue;
3939

40+
import com.google.api.gax.rpc.DeadlineExceededException;
4041
import com.google.api.gax.rpc.NotFoundException;
4142
import com.google.cloud.datastore.AggregationQuery;
4243
import com.google.cloud.datastore.AggregationResult;
@@ -450,8 +451,11 @@ protected void fetchAndValidateTrace(
450451
+ numExpectedSpans
451452
+ ", retrievedSpanCount="
452453
+ retrievedTrace.getSpansCount());
453-
} catch (NotFoundException notFound) {
454-
logger.info("Trace not found, retrying in " + GET_TRACE_RETRY_BACKOFF_MILLIS + " ms");
454+
} catch (NotFoundException | DeadlineExceededException e) {
455+
logger.info(
456+
"Trace not found or deadline exceeded, retrying in "
457+
+ GET_TRACE_RETRY_BACKOFF_MILLIS
458+
+ " ms");
455459
} catch (IndexOutOfBoundsException outOfBoundsException) {
456460
logger.info("Call stack not found in trace. Retrying.");
457461
}

0 commit comments

Comments
 (0)