Repository navigation
test: add explicit owned deadlines for cooperative Effect tests - #617
Merged
Merged
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
Previous Review Summary (commit 2c6eefc)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 2c6eefc)Status: No Issues Found | Recommendation: Merge Files Reviewed (7 files)
Reviewed by free · Input: 46.9K · Output: 2.6K · Cached: 304.2K |
3 of 6 tasks
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.
Issue for this PR
Refs #609. Partial opt-in test harness prevention only. Keep the issue open for remaining hook, Promise and cleanup ownership gaps.
Type of change
What does this PR do?
Add an explicit owned-deadline test API for cooperative, already-provided Effect work. Opt-in live tests bind the same validated, immutable deadline/host-timeout/cleanup-headroom snapshot to Bun registration and execution. The deadline wraps the complete isolated provided/scoped execution, including layer acquisition and finalization. Existing callers and the shared runner are unchanged.
A wall-clock AbortController triggers interruption independently of TestClock. runPromiseExit joins asynchronous finalizers before settling. The deadline is a cancellation trigger, not a finalizer settlement guarantee. Slow, hanging or uninterruptible cleanup can still overrun the host budget. Bun hooks and underlying signal-less Promises are outside this ownership contract. CLI bootstrap tests are deliberately not migrated without cooperation evidence. This does not close #609 or establish the cause of any historical failure.
Own the simple child fixtures used by regression tests with an explicit timer, kill and join in finally. This is not a general process-tree supervisor or a guarantee for SIGTERM-resistant descendants. No existing CI budget is raised; only the new parent regression test declares its own timeout/headroom.
How did you verify your code works?
10 tests / 45 assertions pass locally. Matched child tests prove owner-triggered interruption rather than Bun timeout, followed by named next-test assertions that layer/body or layer-acquisition finalizers completed. Tests also cover TestClock independence, fast success/failure identity, cleared timers, invalid budgets, immutable budget snapshots, slow finalizers, signal-less Promise late work, and timed-out child kill/join.
The baseline private reproduction times out at Bun's host boundary while the next test still sees active global state. No environment-reset substitute is used. Independent prepublication review covered the complete seven-file candidate and its bounded claims. Fresh exact-head CI and independent review are required, including Windows child-process behavior.
Screenshots / recordings
No UI claim. Test harness changes only.
Checklist