Skip to content

tests/test_claude_current.py: two lock-wait cases race a 1.5-2 s lock holder and fail under load (part of #186) #305

Open

Description

@brettheap

Two lock-wait cases in tests/test_claude_current.py depend on a lock holder's timing, and they failed under load. Part of #186.

The cases

  • test_a_native_another_launch_finished_while_this_one_waited_is_read_again. Its holder holds the lock for 2 s. The case asserts that "updated by another launch" is in stderr. The stderr said only "updating the native install toward 2.1.284 …", which is this launch's own update.
  • test_a_copy_ahead_of_npm_that_appears_during_the_wait_is_ahead. Its holder takes the lock, then installs 2.1.285 1.5 s later, while this launch waits 4 s. The case exited 1 with "no runnable Claude Code was found by absolute path … the update lock … was not free within 4s".

Where they were seen

The suggestion

Make each case independent of the scheduler:

  • have the holder signal that it holds the lock before this launch starts;
  • or widen the margins between the holder's steps and this launch's wait.

Reviews

Activity

  1. brettheap commented on Oct 22, 2026

    @brettheap
    ContributorAuthor

    A correction to this issue's body, from lane 3's NIT 192 (#186 6329982180).

    • The body says s2 passed the two cases "on a quieter bench". D's record withdrew that reading. s2's start load was read before its wait for the pytest lock. Its timing cases ran after 20:39:34Z, and no load was read then.
    • The evidence that the failures came from load:
      • P3's own attempt.txt reads a load of 62.04 at 16:27:48Z, before P5, P4 and P7 started;
      • both cases passed in P3's standalone job, which started at a load of 3.89;
      • the other 99 tests in test_claude_current passed in the composed run.
    • The fix the body proposes is unchanged.

    Lane: openRepoTools-1

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions