Skip to content

fix(bench): the gate's benchmark fixture no longer waits for the host lock - #8029

Merged
kixelated merged 1 commit into
mainfrom
fix/bench-fixture-host-lock
Nov 6, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/bench-fixture-host-lock

Conversation

@kixelated

@kixelated kixelated commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Since moq-dev/moq#7867 (merged 2026-11-05), bench/run.sh takes the host-wide benchmark lock, /tmp/moq-bench.lock. bench/build.test.py runs bench/run.sh in a synthetic repo, and just gh test runs that fixture in every just check and just ci. As a result, every gate on a host waits in test gh behind any running benchmark session. Other gates running the same fixture also queue on the lock with it.

On the desktop, one browser benchmark has held the lock since 2026-11-06 07:59 UTC. Four open PRs report test gh stalled behind it for 40 to 60+ minutes: moq-dev/moq#7978, moq-dev/moq#7980, moq-dev/moq#7986, and moq-dev/moq#8014. The lock was meant to keep benchmark sessions apart, not to gate tests.

Approach

The fixture measures nothing. It now overwrites its copied bench/lock.sh with a no-op bench_lock, the same stub bench/profile.test.py already uses. bench/lock.test.py still covers the lock itself. No other gate test reaches the lock:

  • bench/profile.test.py stubs it, or fails argument validation before taking it.
  • bench/local.test.py runs only the --started wrapper.

Impact

  • No public API or wire change. Test fixture only.

Alternatives

  • Set BENCH_LOCK_HELD=1 in the fixture's environment. This works too, but it claims a session the fixture doesn't hold. The stub matches the existing fixture.

Follow-ups

None. Found while re-measuring the gate for quest/m0/ci/five-minutes.md in moq-dev/moq#8004.

Validation

  • Reproduced with the browser benchmark holding the lock: timeout 90 python3 bench/build.test.py timed out (exit 124) waiting for it. With the fix, it passed in 7 s while the same benchmark still held the lock.
  • bash sh/quest.sh gate just check origin/main passed in 112 s (28 s of admission). test gh took 64 s while the lock was still held.
  • ruff check and ruff format --check on the file: pass.

Review

Codex gpt-6.1-sol, medium effort, via quest review --base origin/main (round 1, session 01a1b041-f2ad-7323-b1c5-339b4cca0475), on head 263169df4d: no findings.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

… lock

bench/build.test.py runs bench/run.sh in a synthetic repo, and since the
host-wide benchmark lock landed, run.sh takes /tmp/moq-bench.lock. just gh
test runs the fixture in every just check and just ci, so every gate on a
host waited behind any running benchmark session. The fixture measures
nothing, so it stubs the lock the way bench/profile.test.py already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 6, 2026 09:48
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9bcb2d3d-34de-442c-a51f-3d5c0cea32d7
Commits

Reviewing files that changed from the base of the PR and between 1a6ac47 and 263169d.

Files selected for processing: 1

  • bench/build.test.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Fixture stubs the host lock — bench/build.test.py overwrites its copied bench/lock.sh with bench_lock() { :; }, so the fixture no longer contends for /tmp/moq-bench.lock when just gh test runs it in every gate. This matches the stub bench/profile.test.py already uses.

I verified the stub is sufficient: bench_lock is only reached through source "$ROOT/bench/lock.sh"; bench_lock "$0" "$@" at bench/run.sh:202-203, never as bash bench/lock.sh, and BENCH_LOCK_HELD is consulted only inside lock.sh and bench/local.py — neither is on this fixture's path. Writing the stub before git init/git add . also keeps it inside the fixture's base commit, so the tree run.sh inspects stays clean. The real lock keeps its coverage in bench/lock.test.py.

Ran python3 bench/build.test.py on the head: 1 test, OK in 5.6 s, tree clean afterwards.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 344c2be Nov 6, 2026
10 checks passed
@kixelated
kixelated deleted the fix/bench-fixture-host-lock branch November 6, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant