Skip to content

flaky test: TestMergerTextconvDoesNotFire races with git's own maintenance.lock cleanup #669

Description

@jhrozek

Summary

TestMergerTextconvDoesNotFire (internal/adapter/forker/forker_test.go) intermittently fails under -race with:

Fork: forker: copy base tree: open /tmp/.../.git/objects/maintenance.lock: no such file or directory

Root cause

A TOCTOU race between the fork's .git tree-copy routine listing .git/objects/ and git's own background maintenance process deleting its transient maintenance.lock file before the copy gets around to opening it. Nothing to do with the test's actual subject (textconv/security); it's purely a live-.git-directory-copy race that only surfaces under real filesystem/scheduling contention (-race slows execution enough to expose it; observed on GitHub's shared CI runners, not reliably reproducible on a fast local machine).

Where it was seen

Suggested fix

Snapshot/copy .git/objects/ in a way that tolerates a concurrently-vanishing transient file (e.g., treat ENOENT on a file matching maintenance.lock-style transient git-maintenance artifacts as "skip, not present" rather than a hard copy error), or explicitly exclude known-transient git-maintenance files from the copy set.

Confidence

High — root-caused from the actual CI failure message and the forker's copy-tree code path, not inferred from a pattern match. Not related to any change in the mecak8s Helm-convergence PR stack (#659/#661/#662/#663); pre-existing.

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions