-
Notifications
You must be signed in to change notification settings - Fork 915
Attempt to fix the flakiness of the codegen-generated-classes-test tests. #2769
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
Conversation
ac0b7c8
to
e418313
Compare
if (t == null) { | ||
responseFuture.complete(r); | ||
responseFuture.complete(responseHandlerFuture.join()); |
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.
responseFuture.complete(r)
?
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.
r is Void, since it's from CompletableFuture.allOf
responseHandlerFuture.whenCompleteAsync((r, t) -> { | ||
// When the response handler and HTTP client are done processing the request, use the future completion executor | ||
// to complete the future returned by this function. | ||
CompletableFuture.allOf(responseHandlerFuture, httpClientFuture).whenCompleteAsync((r, t) -> { |
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.
Hopefully there's no edge case where httpClientFuture never gets completed
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.
+1
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.
Can we run integration tests and stability tests if we haven't already?
7a4bd33
to
3d22cfe
Compare
…sts. I wasn't able to reproduce the error locally or in codebuild, which manifests as an index-out-of-bounds exception in BaseAsyncCoreMetricsTest>apiCall_allRetryAttemptsFailedOfNetworkError:108 for async sub-classes. This fixes one potential cause of the error: the result future for an operation can theoretically be completed before the metric gathering future (which is the HTTP call completion future). This change prevents completing the operation future until the HTTP call completion future is completed (in addition to the current future that's checked, the response handling future).
3d22cfe
to
e07fed9
Compare
Kudos, SonarCloud Quality Gate passed! |
…fd6ef6db1 Pull request: release <- staging/507216cd-4b05-4879-ba95-a70fd6ef6db1
I wasn't able to reproduce the error locally or in codebuild, which manifests as an index-out-of-bounds exception in BaseAsyncCoreMetricsTest>apiCall_allRetryAttemptsFailedOfNetworkError:108 for async sub-classes.
This fixes one potential cause of the error: the result future for an operation can theoretically be completed before the metric gathering future (which is the HTTP call completion future). This change prevents completing the operation future until the HTTP call completion future is completed (in addition to the current future that's checked, the response handling future).