Skip to content

Commit 5660e9c

Browse files
committed
test(datastore): Fix flaky ITE2ETracingTest by handling DeadlineExceededException
1 parent 109b62f commit 5660e9c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 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,8 @@ 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("Trace not found or deadline exceeded, retrying in " + GET_TRACE_RETRY_BACKOFF_MILLIS + " ms");
455456
} catch (IndexOutOfBoundsException outOfBoundsException) {
456457
logger.info("Call stack not found in trace. Retrying.");
457458
}

0 commit comments

Comments
 (0)