Skip to content

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

Merged
merged 1 commit into from
Oct 15, 2021

Conversation

millems
Copy link
Contributor

@millems millems commented Oct 13, 2021

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).

@millems millems force-pushed the millem/fix-flakes-2 branch from ac0b7c8 to e418313 Compare October 13, 2021 21:20
if (t == null) {
responseFuture.complete(r);
responseFuture.complete(responseHandlerFuture.join());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

responseFuture.complete(r)?

Copy link
Contributor Author

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) -> {
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

@zoewangg zoewangg left a 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?

@millems millems force-pushed the millem/fix-flakes-2 branch from 7a4bd33 to 3d22cfe Compare October 14, 2021 19:50
…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).
@millems millems force-pushed the millem/fix-flakes-2 branch from 3d22cfe to e07fed9 Compare October 14, 2021 19:54
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@millems millems merged commit dc41c0d into master Oct 15, 2021
@millems millems deleted the millem/fix-flakes-2 branch October 15, 2021 16:35
aws-sdk-java-automation pushed a commit that referenced this pull request Oct 15, 2021
…-test tests. (#2769)"

This caused intermittent test failures.

This reverts commit dc41c0d.
aws-sdk-java-automation added a commit that referenced this pull request Nov 13, 2023
…fd6ef6db1

Pull request: release <- staging/507216cd-4b05-4879-ba95-a70fd6ef6db1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants