Repository navigation
test(core): isolate containment tests from load and concurrent pruning - #245
Merged
Merged
Conversation
The scope re-creation test now works in a private parent cgroup. A createContainmentScope call in another worker prunes empty scopes in the shared delegated cgroup, so it could remove the re-created scope before the assertions ran. The exec classification cases now use deadlines that outlast two full /proc scans on a loaded host. With 60 ms deadlines a slow scan, or an unrelated host process that briefly looks mid-exec, left cleanup unconfirmed. The fixture never settles, so a misclassified exec still fails the test. Closes #220 Closes #238
A fixed pid-based name could collide with a leftover from a killed worker, and a failed cleanup went unreported.
This was referenced Oct 5, 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.
Both flakes come from the tests, not the product. Product code, prune rules and product timeouts are unchanged.
#220: the re-creation test made its scope in the shared delegated cgroup. Any other worker that calls
createContainmentScopeprunes emptypickforge-*siblings there. That removed the scope before the assertions ran. The test now builds its scope in a private parent cgroup,desk-recreate-<pid>. This name has nopickforge-prefix, so pruning never touches it. The test still checks thatensureContainmentScopere-creates the pruned directory with the same token and path.#238:
destroyContainmentScopeconfirms only after two empty scans of all of/proc, with a 25 ms poll between them. The classification cases gave each sweep 60 ms. On a loaded host, one scan can take longer than that. The cases now use 2000/1000 ms. A clean run still returns after about 80 ms. The fixture never settles, so a misclassified exec still fails, after about 3 s. A temporary mutation that removed thePF_KTHREADfilter confirmed this; the mutation was reverted.QA pass skipped: this change is test-only and has no user-facing behavior.
destroyContainmentScopeon a fresh scope under exec churnPF_KTHREADfilter removedvitest run packages/core/test/containment.test.ts--base origin/mainCloses #220
Closes #238