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

test: increasing timeout in testServerStreamingStart #2308

Merged
merged 1 commit into from
Dec 15, 2023
Merged

test: increasing timeout in testServerStreamingStart #2308

merged 1 commit into from
Dec 15, 2023

Conversation

suztomo
Copy link
Member

@suztomo suztomo commented Dec 15, 2023

Fixes #1678

The assertion error tells latch.await(2, TimeUnit.SECONDS) did not return true.

https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CountDownLatch.html#await-long-java.util.concurrent.TimeUnit-

Returns:
true if the count reached zero and false if the waiting time elapsed before the count reached zero

Under a multithreading test, there's no guarantee that latch.await(2, TimeUnit.SECONDS) finishes within 2 second.
Increasing the value to 60 second to (drastically) reduce the flakiness. (This is the same tactics as #2291)

Will this 60-second timeout make the test execution slower? => No, it won't. CountDownLatch.await(timeout) returns immediately when the count becomes zero, without waiting for timeout.

Fixes #1678

The assertion error tells `latch.await(2, TimeUnit.SECONDS)` did
not return true.

https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CountDownLatch.html#await-long-java.util.concurrent.TimeUnit-

> Returns:
> true if the count reached zero and false if the waiting time elapsed before the count reached zero

Under a multithreading test, there's no guarantee that
`latch.await(2, TimeUnit.SECONDS)` finishes within 2 second.
Increasing the value to 60 second to (drastically) reduce the
flakiness.
@suztomo suztomo requested a review from a team as a code owner December 15, 2023 17:16
@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Dec 15, 2023
Copy link

sonarcloud bot commented Dec 15, 2023

Quality Gate Passed Quality Gate passed for 'gapic-generator-java-root'

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Dec 15, 2023

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Collaborator

@JoeWang1127 JoeWang1127 left a comment

Choose a reason for hiding this comment

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

Let's merge this now.

@suztomo suztomo merged commit c9cf66b into main Dec 15, 2023
37 checks passed
@suztomo suztomo deleted the i1678 branch December 15, 2023 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gax-java(mac): Flaky HttpJsonDirectServerStreamingCallableTest.testServerStreaming
2 participants