Repository navigation
Poll CI every 100ms in the test harness - #216
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The test harness now polls CI every 100ms, not every 10ms. The grace period stays at 300ms. No product change.
// tests/support/mod.rs, Scenario::command .env("THIRDSHIFT_CI_GRACE_MS", "300") -.env("THIRDSHIFT_POLL_MS", "10"); +.env("THIRDSHIFT_POLL_MS", "100");The comment above that line now says why 100ms was chosen. The comment in
tests/ci.rson the mergeability countdown (it needs a fourth read and overrides the grace period to 5000ms) is updated to match the new interval.What this buys: very little under load. Each read starts the Python fake
gh, and one start costs 0.07–0.17s wall here. So polls were already paced by process startup, not by the 10ms sleep. I added a counter to the fake to count its starts (not committed):ghstartscibinarymerge_runbinaryno_checks_within_the_grace_periodalone (3 runs)a_pr_whose_mergeability_stays_unknownalone (3 runs)Only the scenarios bounded by the grace period save anything, about 2 reads each. On an idle machine, where a start is cheaper, the saving would be larger. 50ms, 100ms and 200ms all passed and gave about the same counts, so I used the ticket's suggested 100ms. The measurements don't favour one over the others.
The same states are still tested.
pending_polls) and the mergeability countdown (unknown_polls) count reads, not time.on-ci-readhooks show up on the first read.poll::withinalways probes at least once before checking the deadline, so the absent and stays-unknown paths still fire.Evidence
Same machine: 4 cores, rustc 1.98.1. Other Runs were active the whole time, and the load was not steady (mean 1-minute load noted). The wall times are not comparable across rows; user + sys is the meaningful column.
cargo testcimerge_runspec_runThe per-binary loads were about 11–13 before and 13–15 after.
ciandmerge_rungot slower in wall time while their CPU held or dropped. That fits both noisy load and the longer sleep between reads when checks are pending. A secondcirun at 100ms took 24.3s wall and 24.1 + 9.5s. User + sys fell by about 2% overall. This lever does little toward #174's "half the CPU" target: the cost is in starting processes, not in how often the harness polls.cargo testpasses: 432 tests, 0 failures, across 24 test binaries.Merge Danger
Door: two-way
Revert the one value.
Blast Radius: test-harness
Only the test harness's CI poll interval changes. Scenarios that wait on pending checks now sleep 100ms between reads instead of 10ms.
Unaddressed findings
Standards
None.
Spec
None. The spec review's findings (the process count barely moves under load, 100ms isn't favoured by the measurements, the loads aren't comparable,
ci's wall time went up) are reported above rather than hidden.Closes #204
🤖 Generated with Claude Code