Skip to content

test(core): isolate containment tests from concurrent runs and load - #254

Merged
ElbertePlinio merged 5 commits into
mainfrom
fix/250-containment-test-isolation
Oct 6, 2026
Merged

ElbertePlinio merged 5 commits into
mainfrom
fix/250-containment-test-isolation

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

The containment tests now hold up under load and when two runs share the host. Every scope ID in the shared delegated cgroup gets a per-run suffix. "always produces a usable scope" creates its scope from a worker inside a private parent cgroup, so concurrent pruning cannot remove it. Sweeps whose result needs two empty /proc scans get a 2000/1000 ms budget, and the kill-sweep test now also checks that only SIGKILL was sent. The single-empty test scans only its fixture and checks that exactly two scans ran. The zombie and completed-environment cases now check how often the fixture's environ is read, so they fail without their filters. Product code is unchanged.

While working on this I found that fixed IDs let two runs hold scopes for the same cgroup directory. A process that joins between the member check and the cgroup.kill write is killed even if it carries another token. That is harmless while real IDs are random, and it is filed as #258.

Closes #250

Requirement Verification Scenario Result Evidence
Isolate remaining shared-cgroup tests from concurrent pruning Automated test A pruner removing empty scope dirs during the run origin/main 3/5 fail, branch 10/10 pass 250/item1-pruner-*.log
Size short sweep deadlines for two full /proc scans Automated test Pinned to 2 CPUs with 8 busy loops, load 69 to 97 10/10 pass 250/final-pinned-churn.log
Single-empty observation test is reliable Automated test plus forced proof Unrelated same-user process caught mid-exec Cause proven, test scoped to its fixture 250/item2-single-empty-foreign-midexec-proof.log
Per-run suffix for fixed scope names Automated test Two concurrent runs of the file, 10 rounds origin/main 3/6 fail, branch 20/20 pass 250/final-concurrent-summary.log
Zombie and completed-environment cases fail without their filters Mutation check Each filter in readMidExecIdentity deleted in turn Branch cases fail, origin/main cases pass 250/final-mutation-*.log
Lint, typecheck, PickCheck Automated Final head Pass CI

Evidence lives in ~/Artifacts/pickforge-kickoff-2026-10-06/ on the dev host. The QA pass was skipped because this is a test-only change with nothing to drive.

Give scope ids that name a shared cgroup directory a per-run suffix, so
two concurrent runs never share one pickforge-<id> scope. Create the
fresh scope of the creation test from inside a private parent cgroup,
so a concurrent prune cannot remove it before it is inspected.

Give the kill sweep after a zero term deadline the default kill
deadline and check that it sent SIGKILL. Limit the single-empty test's
scans to its fixture, so an unrelated process caught mid-exec cannot
change the reason. Check that the classification cases never re-read
the fixture's environment, which fails when the zombie or completed
environment filter is removed.

Refs #250
Refusal and confirmation cases gave each sweep 200 or 300 ms, but their
outcome needs two empty scans of all of /proc first. Under pinned load
a scan outlasts that, and the reason becomes the missing empty scans.
Share the 2000/1000 ms budget the classification cases already use.

Refs #250
A concurrent creator's prune could remove the probe scope from the shared
delegated cgroup before its cgroup.kill check. The file then treated a
delegated host as marker-only. Probe through the create worker inside a
private parent instead, and drop an assertion the exact path check implies.
…orge/pickforge into fix/250-containment-test-isolation
@ElbertePlinio
ElbertePlinio merged commit 1d9058f into main Oct 6, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/250-containment-test-isolation branch October 6, 2026 14:18
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.

test: remaining containment test load and isolation weaknesses

1 participant