Skip to content

test: introduce awaitility to sdk-platform-java#13458

Merged
blakeli0 merged 5 commits into
googleapis:mainfrom
blakeli0:feat/introduce-awaitility-sdk-platform
Jun 15, 2026
Merged

test: introduce awaitility to sdk-platform-java#13458
blakeli0 merged 5 commits into
googleapis:mainfrom
blakeli0:feat/introduce-awaitility-sdk-platform

Conversation

@blakeli0

@blakeli0 blakeli0 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

This PR

  • Introduces awaitility version 4.3.0 to gapic-generator-java-pom-parent and gax-java.
  • Migrate one test ThresholdBatcherTest to use it as an example.

This is the first PR of b/505479343. Follow up PRs would migrate all tests in sdk-platform-java to use awaitility.

Introduces awaitility version 4.3.0 to gapic-generator-java-pom-parent and gax-java, and migrates ThresholdBatcherTest to use it with 1 second timeouts instead of brittle Thread.sleep.
@blakeli0 blakeli0 requested review from a team as code owners June 12, 2026 20:30

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the Awaitility library to replace Thread.sleep calls with asynchronous assertions in ThresholdBatcherTest.java, improving test reliability. The review feedback points out a critical build issue in gax-java/pom.xml where the ${awaitility.version} property is undefined, and recommends increasing the await timeout from 1 second to 5 seconds in the tests to prevent flakiness in resource-constrained CI environments.

Comment thread sdk-platform-java/gax-java/pom.xml
@blakeli0 blakeli0 requested a review from lqiu96 June 12, 2026 20:34
@blakeli0 blakeli0 changed the title chore(deps): introduce awaitility to sdk-platform-java test: introduce awaitility to sdk-platform-java Jun 12, 2026
@blakeli0 blakeli0 force-pushed the feat/introduce-awaitility-sdk-platform branch from 9397b32 to 0643d31 Compare June 15, 2026 17:57
@blakeli0 blakeli0 merged commit f31da65 into googleapis:main Jun 15, 2026
523 of 530 checks passed
blakeli0 added a commit that referenced this pull request Jun 17, 2026
…ts (#13484)

This PR migrates all remaining wait loops and polling blocks in GAX
tests to use Awaitility. This is the second part of b/505479343,
following the initial introduction of Awaitility in #13458.

Specifically, this migrates:
- Semaphore64Test: replaced mock thread wait loops with Awaitility state
waiting.
- ScheduledRetryingExecutorTest: migrated future attempt checking,
attempt cancellation wait, and first attempt latch count down to
Awaitility.
- BatcherImplTest: converted GC loops and thread state polling blocks to
Awaitility.
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