Skip to content

Fix flaky tests in crt http client #5022

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 3 commits into from
Mar 19, 2024
Merged

Fix flaky tests in crt http client #5022

merged 3 commits into from
Mar 19, 2024

Conversation

zoewangg
Copy link
Contributor

Motivation and Context

Fix flaky tests in crt http client

@zoewangg zoewangg requested a review from a team as a code owner March 15, 2024 22:58
Comment on lines -203 to -208
AtomicInteger whenCompleteTracker = new AtomicInteger(0);
CompletableFuture<Void> onResponseComplete = CompletableFuture.runAsync(() -> handler.onResponseComplete(httpStream, 0))
.whenComplete((r, t) -> whenCompleteTracker.compareAndSet(0, 1));

CompletableFuture<Void> writeComplete = CompletableFuture.runAsync(() -> future.complete(null))
.whenComplete((r, t) -> whenCompleteTracker.compareAndSet(0, 2));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Testing race condition could introduce more race conditions... so I removed it.

@zoewangg zoewangg enabled auto-merge (squash) March 18, 2024 20:28
Copy link

@zoewangg zoewangg merged commit 700f7b9 into master Mar 19, 2024
akidambisrinivasan pushed a commit to akidambisrinivasan/aws-sdk-java-v2 that referenced this pull request Jun 28, 2024
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.

2 participants