Skip to content

Fix Flaky S3JavaMultipartTransferProgressListenerTest test case #5918

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 4, 2025

Conversation

joviegas
Copy link
Contributor

Motivation and Context

  • S3JavaMultipartTransferProgressListenerTest failed number of times in PR Codebuild check builds

[ERROR] Tests run: 12, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 9.115 s <<< FAILURE! -- in software.amazon.awssdk.transfer.s3.internal.S3JavaMultipartTransferProgressListenerTest
[ERROR] software.amazon.awssdk.transfer.s3.internal.S3JavaMultipartTransferProgressListenerTest.copyWithJavaBasedClient_listeners_reports_ProgressWhenSuccess_copy -- Time elapsed: 0.632 s <<< FAILURE!
org.opentest4j.AssertionFailedError: 

Expecting value to be true but was false
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

Modifications

  • Earlier the tets cases was waiting for 500 ms for CaptureListener to complete
  • Added a finite pre-emptive assert to wait fort CaptureListener to complete and then do the assertions

Testing

Screenshots (if appropriate)

License

  • I confirm that this pull request can be released under the Apache 2 license

@joviegas joviegas requested a review from a team as a code owner February 28, 2025 23:11


private static void assertTransferListenerCompletion(CaptureTransferListener transferListener) {
assertTimeoutPreemptively(
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a small message to assertTimeoutPreemptively (there is an overload method that accepts one) that mentions the transfer didn't finish within 5 seconds or something like that?

@joviegas joviegas enabled auto-merge March 3, 2025 17:55
Copy link

sonarqubecloud bot commented Mar 3, 2025

@joviegas joviegas added this pull request to the merge queue Mar 3, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 3, 2025
@joviegas joviegas added this pull request to the merge queue Mar 4, 2025
Merged via the queue into master with commit 70b7438 Mar 4, 2025
17 checks passed
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