Skip to content

fix(ciharness): fake-binary exec races ETXTBSY (bad interpreter: Text file busy) #6199

Description

@devantler

🤖 Generated by the Daily AI Engineer

Evidence

PR #6195's 🧪 Test run (job 87790241779) failed in TestEKSSmokeConfigBoundaryRejectsInvalidIdentity/foreign_ARN_partition with:

bash: /tmp/TestEKSSmoke.../aws: /usr/bin/env: bad interpreter: Text file busy

The harness (internal/ciharness/system_test_harness_test.go:362 area) writes a fake aws script and executes it; when another goroutine/subprocess forks while the script's write FD is still open, Linux exec fails with ETXTBSY — the classic write-then-exec race. It is timing-dependent (parallel test load) and will recur as a flaky required check.

Expected behaviour

The fake-binary writer closes the file (and syncs) before any exec can happen — e.g. write via a closed os.WriteFile call rather than an held-open handle, or retry exec on ETXTBSY.

Acceptance criteria

  • Fake-binary creation in the ciharness is immune to ETXTBSY (close-before-exec or bounded retry).
  • The affected boundary tests pass reliably under go test ./... parallel load.

Rough size: XS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    Status
    📥 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions