-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(datastore): reduce flakiness of E2E tracing tests #13645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
1e5a18c
9493964
91b9e21
6d01781
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -227,14 +227,12 @@ private boolean dfsContainsCallStack(long spanId, List<String> expectedCallStack | |
|
|
||
| private static final int NUM_SPAN_ID_BYTES = 16; | ||
|
|
||
| private static final int GET_TRACE_RETRY_COUNT = 60; | ||
| private static final int GET_TRACE_RETRY_COUNT = 120; | ||
|
|
||
| private static final int GET_TRACE_RETRY_BACKOFF_MILLIS = 1000; | ||
|
|
||
| private static final int TRACE_FORCE_FLUSH_MILLIS = 5000; | ||
|
|
||
| private static final int TRACE_PROVIDER_SHUTDOWN_MILLIS = 1000; | ||
|
|
||
| private static Key KEY1; | ||
|
|
||
| private static Key KEY2; | ||
|
|
@@ -393,6 +391,9 @@ public void after() throws Exception { | |
| tracer = null; | ||
| retrievedTrace = null; | ||
| customSpanContext = null; | ||
| if (openTelemetrySdk != null) { | ||
| openTelemetrySdk.close(); | ||
| } | ||
| openTelemetrySdk = null; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The try {
if (openTelemetrySdk != null) {
openTelemetrySdk.close();
}
} finally {
if (traceExporter != null) {
traceExporter.close();
}
}
openTelemetrySdk = null;
traceExporter = null;References
|
||
| } | ||
|
|
||
|
|
@@ -441,6 +442,9 @@ protected void waitForTracesToComplete() throws Exception { | |
| CompletableResultCode completableResultCode = | ||
| openTelemetrySdk.getSdkTracerProvider().forceFlush(); | ||
| completableResultCode.join(TRACE_FORCE_FLUSH_MILLIS, TimeUnit.MILLISECONDS); | ||
| if (!completableResultCode.isSuccess()) { | ||
| logger.warning("Force flush did not complete successfully"); | ||
| } | ||
|
Comment on lines
460
to
+465
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If if (openTelemetrySdk != null) {
CompletableResultCode completableResultCode =
openTelemetrySdk.getSdkTracerProvider().forceFlush();
completableResultCode.join(TRACE_FORCE_FLUSH_MILLIS, TimeUnit.MILLISECONDS);
if (!completableResultCode.isSuccess()) {
logger.warning("Force flush did not complete successfully");
}
} else if (traceExporter != null) {
CompletableResultCode completableResultCode = traceExporter.flush();
completableResultCode.join(TRACE_FORCE_FLUSH_MILLIS, TimeUnit.MILLISECONDS);
if (!completableResultCode.isSuccess()) {
logger.warning("Trace exporter flush did not complete successfully");
}
}References
|
||
| } | ||
|
|
||
| // Validates `retrievedTrace`. Cloud Trace indexes traces w/ eventual consistency, even when | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that we do
Thread.sleepafter each unsuccessful check, consider migrate the test to useAwaitility?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raised a PR #13668