Skip to content
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

Fix flakyness in LoggingTransferListenerTest where LogCaptor captures logs from other parrallely running test cases #5948

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

joviegas
Copy link
Contributor

Motivation and Context

LogCaptor events are not filtered before comparing that causes incorrect assertion on logs and irrelevant logs are added in assertions

[ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.039 s <<< FAILURE! -- in software.amazon.awssdk.transfer.s3.progress.LoggingTransferListenerTest
[ERROR] software.amazon.awssdk.transfer.s3.progress.LoggingTransferListenerTest.test_customTicksListener_successfulTransfer -- Time elapsed: 0.027 s <<< FAILURE!
org.opentest4j.AssertionFailedError:

expected: "|==== | 80.0%"
but was: "Retrying Request: DefaultSdkHttpFullRequest(httpMethod=PUT, protocol=http, host=localhost, port=42741, encodedPath=/bucket/key, headers=[amz-sdk-invocation-id, Content-encoding, Content-Length, Content-Type, Expect, User-Agent, x-amz-content-sha256, x-amz-decoded-content-length, x-amz-sdk-checksum-algorithm, x-amz-trailer], queryParameters=[partNumber, uploadId])"
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at software.amazon.awssdk.transfer.s3.progress.LoggingTransferListenerTest.assertLogged(LoggingTransferListenerTest.java:123)

Modifications

  • LogCaptor Events are filtered , to consider only LoggingTransferListener

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 March 11, 2025 04:31
@joviegas joviegas force-pushed the joviegas/LoggingTransferListenerTest_flakyTest branch from d131d45 to d1fadd2 Compare March 11, 2025 15:02
@joviegas joviegas added this pull request to the merge queue Mar 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 11, 2025
@joviegas joviegas added this pull request to the merge queue Mar 11, 2025
Merged via the queue into master with commit 302473f Mar 11, 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