Skip to content

test: make async tool and guardrail tests deterministic - #4192

Merged
seratch merged 1 commit into
mainfrom
test/deterministic-async-tests
Aug 5, 2026
Merged

test: make async tool and guardrail tests deterministic#4192
seratch merged 1 commit into
mainfrom
test/deterministic-async-tests

Conversation

@seratch

@seratch seratch commented Aug 5, 2026

Copy link
Copy Markdown
Member

This pull request improves timing-sensitive tool and guardrail tests by replacing scheduler-dependent sleeps and timestamp races with explicit causal rendezvous.

It preserves the existing synchronous function-tool, streaming, cancellation, post-invoke drain, and late-cleanup execution paths. Loop-owned events are signaled safely from worker threads, test-local drain budgets keep scheduling delays from deciding failure arbitration, and blocked cleanup work is released from finally blocks so failed assertions cannot leave tasks behind.

This incorporates the work from #4165 while preserving the original contributor's authorship through the commit's Co-authored-by trailer.

Replace scheduler-dependent timing races with explicit rendezvous while preserving sync-tool, streaming, cancellation, and background-cleanup paths.

Co-authored-by: Shaurya Singh <sshaurya914@gmail.com>
@seratch seratch added this to the 0.19.x milestone Aug 5, 2026
@seratch seratch added the project label Aug 5, 2026
@seratch
seratch enabled auto-merge (squash) August 5, 2026 01:48
@seratch
seratch merged commit bf00f45 into main Aug 5, 2026
9 checks passed
@seratch
seratch deleted the test/deterministic-async-tests branch August 5, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant