Skip to content

test: containment scope re-creation races concurrent pruning #220

Closed

Description

@ElbertePlinio

Problem

packages/core/test/containment.test.ts > "scope re-creation" > "re-creates an empty scope cgroup that was pruned under it" can fail in the full parallel suite on a delegated-cgroup host:

AssertionError: expected false to be true
 ❯ packages/core/test/containment.test.ts:1514:56
    expect(fs.existsSync(ensured.cgroupDir as string)).toBe(true);

ensureContainmentScope re-creates the empty scope cgroup. A createContainmentScope call in another Vitest worker prunes empty sibling scope cgroups in the same parent, so it can remove the fresh empty scope before the assertion runs. This is a test race in the same prune window as #190, not a product regression.

Where it was found

Local validation for PR #218 (#199) at 995c662. It failed once in one full bun run test:coverage run and passed in the next full run. It passed 3 of 3 times alone on that branch and 3 of 3 times on origin/main b9ea7ce. The PR does not touch containment code.

Acceptance criteria

  • The test proves re-creation without depending on an empty sibling scope surviving concurrent pruning, for example by asserting inside a private parent cgroup or by checking the returned scope before another worker can prune it.
  • Product behavior and prune semantics stay unchanged.

Checklist

  • Isolate the test from concurrent pruning
  • Run the full parallel suite several times on a delegated-cgroup host without the failure

Activity

  1. added
    bug
    on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions