Skip to content

flaky test: setup_worktree_requires_candidate_prefix_before_side_effects fails ~1/8 on dev (ULID candidate can satisfy the prefix check) #306

Description

@loning

setup_worktree_requires_candidate_prefix_before_side_effects in
crates/fkst-framework/tests/sdk_git.rs fails nondeterministically on dev.

Reproduced on pristine origin/dev (change stashed, sdk_git binary run 8 times):

run1 ok 52/0   run2 ok 52/0   run3 ok 52/0   run4 ok 52/0
run5 ok 52/0   run6 FAILED 51/1   run7 ok 52/0   run8 ok 52/0
-> 1/8 failure rate

Failure:

thread 'setup_worktree_requires_candidate_prefix_before_side_effects' panicked at
  crates/fkst-framework/tests/sdk_git.rs:843:18:
called `Result::unwrap_err()` on an `Ok` value:
  ".../.fkst/runtime/worktrees/c3-test-01KZ5XQG1G6VPH70T7JPYM..."
CMD=git worktree add -b env-rc-20260804-c3-test-01KZ5XQG1G6VPH70T7JPYM...

The test asserts setup_worktree rejects a candidate lacking the required prefix, then
unwrap_err()s. The candidate embeds a ULID (01KZ5XQG…), which is random per run, so the
generated name intermittently satisfies the prefix check and setup_worktree returns Ok
panicking the assertion.

Because the randomness is in the fixture rather than the code under test, the fix is to make the
candidate deterministic (or explicitly construct one guaranteed to violate the prefix rule) rather
than to relax the assertion.

Discovered while gating #299 / #305: a 3× full-parallel-suite gate showed one red run, and the
pristine repetition above established it is pre-existing and unrelated to that change. Filed
separately so the engine fix is not bundled with an unrelated test repair.

⟦AI:FKST⟧

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions