Repository navigation
test: run the suite on tmpfs and drop sleeps, timing harnesses, and trivial tests - #503
Conversation
Session tests commit SQLite with synchronous=FULL; on a disk TMPDIR fsync was ~85% of their wall time. A nextest setup script points TMPDIR at /dev/shm on Linux (QQ_TEST_DISK_TMPDIR=1 opts out). The full ci profile drops from 449 s to 34 s on the shared host. The deadline-during-shell test expired the run between spawn and the shell's first write, so on fast storage the captured output was empty. It now waits for a marker the shell writes after printing.
… cycle The three-day outage replayed ~140 identical 30-minute ceiling wakes after the backoff had already been proven bounded; six hours reaches the ceiling again after the committed-work reset. 112 s -> 4 s each on disk; 23 s -> 4 s on tmpfs.
Three side-question latency diagnostics ran in every CI run and only printed percentiles; five ignored harnesses printed timings for one-off manual comparisons. Benchmarks belong in benches/ or xtask perf. The slow keyring's delay was always zero after its benchmark went; it is now a counting keyring with no sleep.
…io's Upper bounds on elapsed wall time are perf budgets, and they flake under load. The behavior each test checks (the error, the outcome, the lower bound) stays. The herdr timeout and the limited-stream deadline tests run on paused time instead of waiting out real 500 ms deadlines; the MCP cancellation test cancels once the call is active instead of after a 20 ms sleep.
They pin private structure (a struct's byte size, a private field's setter), restate a format! string, or call a pure function twice. The behaviors they touch are asserted with literal values elsewhere.
The group-commit tests slept 20-50 ms so jobs would reach the worker's queues before release. They now wait until the bounded channels hold the expected messages; the saturated-submission check yields a fixed number of times on its current-thread runtime instead of sleeping 10 ms.
Nothing the twelve users assert depends on the provider being slow; each waits on run events. Ran each 15 times on tmpfs with 8 threads: no failures.
- fingerprint and plan-cache tests set the file mtime a second ahead instead of sleeping 20 ms for timestamp granularity - the concurrent-miss test holds its compile until all 16 callers have asked, rather than sleeping 10 ms inside it - poll loops in side-question, auth, host, and TUI tests yield instead of sleeping 2-20 ms per iteration - the host observer test no longer asserts a 250 ms median ack - the paused-time retry sleep and the client's drip rate are marked as allowed sleeps (one is virtual, the other is the behavior under test)
Each of these loops waits on observable state (a counter, a request list, a snapshot); the sleep only added latency per iteration.
It samples RSS and polls a real child process; it is the documented R4 procedure in benchmarks/perf/README.md, run on demand in release mode.
Process-kill soak workers, /proc checks for killed process groups, and the non-blocking loopback accept poll real OS state with no wake signal; they are now allowed sleeps with reasons. Two in-process soak waits yield instead.
The 1 ms pause between response chunks guaranteed nothing a reader can observe over TCP; provider, host, auth, and xtask suites pass five runs in a row without it. The scripted stall, the MCP slow tool, the dispatch test tool's blocking delay, and the /proc poll for a killed shell are the behavior under test and are marked as allowed sleeps.
With fsync gone the slow tests are the goal-driver soaks, deadline and compaction suites, the soak binary, and the perf fixtures. Starting them first moves the ci profile from ~25 s to ~20 s at 8 threads.
Each built the same fixture, ran to the end, and asserted the same budget_exhausted outcome with one case-specific check; they are now rows.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: daaef58344
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Change
The workspace test suite runs about 22x faster:
cargo nextest run --workspace --profile cigoes from 449 s to 20 s wall, and from 3,512 s to 159 s summed across tests.synchronous = FULL. On a disk-backed TMPDIR, fsync was about 85% of each session test's wall time (strace: 5.7 s of a 6.5 s test). A nextest setup script (.config/nextest-tmpdir.sh) pointsTMPDIRat/dev/shm/qq-test-$UIDon Linux. It falls back to the default TMPDIR when/dev/shmis missing, unwritable,noexec, or has under 2 GiB free.QQ_TEST_DISK_TMPDIR=1turns it off.Notify, waiting for store queue depth, explicit mtimes, or yields.SLEEP_CEILINGgoes from 66 to 11. Each remaining sleep polls a real process or socket and is markedlint: allow(sleep).Verification
cargo nextest run --workspace --profile ci: 2882 passed, 10 skipped, 20.0 s wall (host load about 2). Baseline on061420e0: 2894 passed, 15 skipped, 449 s (load 15.7).cargo xtask check: passed after rebasing onto46db8cf2(full workspace, 102 s).Known impact
setup-scriptsrun on CI runners. If/dev/shmis too small there, the script falls back to disk: the suite is slower but still correct.docs/runbooks/testing.md.