Repository navigation
Stabilize command and moderation timing tests - #1193
Conversation
There was a problem hiding this comment.
ℹ️ No blocking issues. Two latency checks can accept late results.
Approach — Fixed clocks and fixture signals remove timing dependencies while preserving the SQLite and loopback paths the tests exercise.
Reviewed changes — Reviewed all 11 files in the PR.
- Command timing — Checked the timed-ban clock, slash backoff fixture, and stats and status latency checks.
- Moderation timing — Traced the paused clocks and signals used by automod, case inserts, gateway audit retries, member-sync pacing, and image capture.
- Flake allowlist — Reviewed the removal of the 39 entries associated with this work.
Non-blocking
- The latency tests can pass when the operation exceeds its limit. Tokio polls the inner future first, so a blocking step during final stats rendering can push the operation past 650 ms and still return
Ok. The status render starts when the worker sends readiness, andrecv_timeoutstarts when the receiver runs. If the receiver is descheduled between those points, it can accept a buffered result from a render that took longer than 200 ms. Keep the fixture setup outside the timed sections and assert elapsed time around each operation, measuring the status render inside the worker. Stats test · Status test · Pinned Tokio timeout implementation · Rustrecv_timeoutdocumentation
Verification was by source inspection. I did not rerun the Rust suite.
gpt-6.2-sol | 𝕏
4cf0327 to
7994c14
Compare
|
Addressed Pullfrog review 6206300380 in 7994c14. The status test starts and checks its 200 ms deadline on the thread that renders. The stats test retains its 650 ms Tokio watchdog and checks a monotonic deadline again after the future returns. A deliberately blocked final synchronous poll now fails even when Tokio returns the result. Both setup-delay controls passed, and both in-operation delays failed at their original limits. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review at 4cf0327.
- Restored the timing assertions. The stats and synchronous status tests check monotonic deadlines on completion, so a late render fails even if it returns a result. Pinned Crossbeam implementation
- Verified registration during reconciliation. The fixture holds SQLite in its transaction authorizer while the same-subject ban observation registers, then exercises the busy retry and checks attribution. SQLite authorizer documentation
- Held the mock ban pending. The per-bot capture probe observes capture from spawned tasks before the fixture releases the ban, then the test checks capture ordering and persistence. Pinned Tokio clock implementation
- Integrated the allowlist cleanup. The rebased allowlist contains only its two header lines.
cargo fmt --check and bash scripts/ci-preflight.sh --only contracts passed locally. The Rust tests and Dylint were still running in PR CI and were not rerun locally. PR CI run
gpt-6.2-sol | 𝕏

Part of #666.
Changes
Remove 39 command and moderation allowlist rows covering 54 occurrences. With their allowances removed on the original baseline, Dylint reported 51 findings. The other three rows were already stale. With #1192 merged, these are the final 39 rows on main. The proposed allowlist contains only its two header lines.
The ban-expiry command and gateway startup fixtures supply fixed clocks at the existing timestamp reads. Normal command execution and gateway startup still read UTC. Case inserts, audit retries, pacing persistence and image capture now signal the steps their tests need to observe. The tests still use SQLite and loopback peers, and keep the existing timing bounds for a stalled insert, a hung stats request and synchronous status rendering.
Verification
cargo fmt --check,cargo clippy --locked -p jmodguard-bot -p jmodguard --all-targets -- -D warnings, Dylint for both packages andbash scripts/ci-preflight.sh --only contracts. Dylint reported zero assigned findings. The 14 inherited bot and 27 inherited core diagnostics are tracked separately under test: audit CI history for flaky tests and fix them #666.One earlier module invocation reused mutation build output. It was excluded, and a clean rebuild reproduced the original verified test binary byte for byte. Only executions against verified source are counted.
Summary by Sourcery
Stabilize command and moderation timing tests and remove their resolved flake allowances.
Enhancements:
Build:
crossbeam-channelas a bot development dependency.Tests: