Skip to content

check-contract-slice-prune.test.sh is flaky in CI: fixture cleanup race fails contract-slice-prune-gate #2918

Closed

Description

@kyle-sexton

What

scripts/check-contract-slice-prune.test.sh intermittently fails the contract-slice-prune-gate job on pull requests that do not touch the code under test.

Observed on the ci workflow run for #2847:

  • Failing case: carrying existing debt to a new root must not be red-lined
  • Log line: rm: cannot remove … Directory not empty
  • The same test passed 33 of 33 consecutive local runs at the same commit
  • A CI re-run went green with no change

Why it matters

This is the expensive kind of flake. It turns a green branch red for reasons unrelated to its diff, and it teaches everyone who sees it to re-run rather than read the failure — which is how a real failure eventually gets re-run past.

It cost a merge cycle during the #2847 landing.

Likely mechanism

A fixture-cleanup race. Candidates worth checking, in rough order of likelihood:

  • A trap-based cleanup firing while a background process still holds a handle under the fixture directory.
  • A fixture path not unique per case, so two cases collide when timing shifts.
  • A rm -rf racing a subshell that is still writing.

CI is ubuntu-24.04 with git 2.54.0, so the mechanism that matters for the gate is a Linux one. Reproducing it may need a loop, concurrent case execution, or a contended filesystem — a container matching the CI image is the most direct route, since the failure has not been reproduced on Windows.

Definition of done

Root cause identified and fixed, plus a deterministic regression case. A stress loop is acceptable supporting evidence but is not a substitute for a test that fails before the fix and passes after.

If the race cannot be reproduced, that should be stated openly rather than papered over with a speculative fix — a flake fixed by guessing is a flake moved, not removed.

Activity

  1. added
    needs-triage
    on Aug 17, 2026
  2. added 2 commits that reference this issue on Aug 17, 2026
    8b78f6f
    1181505
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

    needs-triage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions