Repository navigation
ci(harness): make async wait timeout tests deterministic - #3529
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
jujn
approved these changes
Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AgentScope-Java Version
2.1.0-SNAPSHOT
Description
WaitAsyncResultsToolTest.timeoutClampedToMaxcurrently spends 120 seconds waiting for an empty inbox. The test namednullTimeoutUsesDefaultpasses1, so it does not exercise the actual 60-second default.Add package-local clock and sleep injection to run those same polling loops with virtual elapsed time. The public constructors still use
System.currentTimeMillisandThread.sleep; production timeout values and polling behavior remain unchanged.The tests now check the 600 → 120 clamp, null → 60 default, remaining sleep budget, consecutive-empty accounting and incomplete task barriers. A real-thread interruption test uses the public constructor, alongside a deterministic check that interruption restores the flag without consuming the empty-wait budget. Existing real async-completion tests remain.
This is a narrow test-time slice of #3521, not a change to test parallelism or the whole build optimization assigned there. #2797 touches the same class for async-completion recovery; that functional change remains separate.
Verification
On JDK 17:
WaitAsyncResultsToolTestcases passed in 12.073 seconds, including the retained real waits. The clamp testcase previously took 120.014 seconds locally and now completes without a real 120-second wait. This is a local testcase measurement, not a measured overall CI speedup.Checklist
mvn spotless:applymvn test); selected modules verified above