Repository navigation
Cover short-run timestamp averaging and restore monitor test workloads - #816
Conversation
|
🤖 Automated first-pass review — a human maintainer's review is still required before merge. Thanks, this is test-only and the reasoning in the description holds up. I went through the One structural question:
Nitpicking: the comment above the series loop says "every weight 2..16", but the loop also covers weight 1 (the initial merge into an empty I'd be fine with this as is. The fixture placement is the only thing I'd want a second look at. (would file this as a comment, not a formal block) |
|
Addressed the fixture-precondition point in cf493c2: the helper now explicitly checks requests==0 and pipeline==1, so an earlier request-limit return cannot silently satisfy the producer-budget assertion after a fixture change. The comment now describes the enduring purpose rather than this PR. The fixed unit passes and the isolated cap-removal mutant still fails at the intended producer-budget assertion. I considered a separate top-level test. This keeps the existing two-shard socket/protocol fixture, with the backpressure assertions in their own named helper. The local config changes occur after the repin assertions and immediately before fixture destruction; they do not leak into another test. Duplicating that setup for these three checks would add socket and cleanup code without strengthening the regression. The explicit precondition and assertion messages make the additional contract clear. The independent TEST review also killed strict-greater-than cap, blocked-staged-drain and no-resume mutants; final-head recheck and the other six reviews/full CI remain required. |
|
The interaction review supplied a concrete reason to separate the fixture: #799 adds more transaction assertions at the old insertion point, and its terminal state must not affect a monitor-cap check. In24c3ac6 the backpressure check now has its own fresh scoped two-shard client/listener and a separate top-level test function. The repin test has no configuration or counter changes from this PR. The class helper is also placed away from #799's additions. The fixed unit passes; removing the cap still fails at the intended budget assertion. The independent integration reviewer confirms the final head merges cleanly with all six pending fixes and preserves #799's transaction assertions; composed runtime validation is in progress. Final-head focused rechecks and CI remain required. |
Problem
The short-run timestamp follow-up in #466 remained incomplete: no explicit second-boundary regression, monitor replay still used the 4,000-request workaround, and no small real-server throughput marker covered #463.
Root cause
The old timestamp helper averaged seconds and microseconds separately. The issue's two 200-microsecond intervals straddle a second boundary and expose that truncation deterministically. Production arithmetic is already fixed; this change closes the coverage gap using the existing C++ unit harness, without adding another test framework.
Simply restoring 1,000 requests weakens the monitor latency test: independently disabling the producer cap still passed its 50ms ceiling (13.311ms p99, versus 0.255ms with the cap on this host). A timing ceiling alone cannot protect that smaller workload.
Fix
No production code or output format changes.
Tests
Affected versions
This is test coverage for already-fixed arithmetic. The old helper was introduced by58a1bdbd7c0667d6a53519f88ba93b019690a6d0; containing tags begin at1.2.16. Source inspection confirms the old formula through2.4.3. Mainline fixb4b18c0cf430b6006fcf5f855a58ca6d6e28552a is in2.5.0–2.5.2; backport405d596bffc167291d86046a727785c218a27a7c also fixes2.4.4. The monitor workaround came with1e596c16e57ccafdfa55c9b27eeb24be66506ad9, present in2.4.0–2.5.2 and current master. These ranges are established by git tag --contains plus release-source inspection, not runtime tests of every release.
Fixes #466
🤖 Generated with Claude Code
Note
Low Risk
Adds and adjusts tests only; no runtime, auth, or stats logic changes in production code.
Overview
Test-only follow-up for #466: closes gaps around short-run stats (#463) and monitor-cluster backpressure without changing production code.
run_stats_merge_testaddstest_submillisecond_merge, exercisingrun_stats::merge()across second boundaries so merged duration stays 200µs (not the old ~500ms bug), ops/sec is correct, merge weights 2–16 stay exact, and 1µs durations survive fractional averaging.Monitor / backpressure: integration workloads drop from 4000 → 1000 requests now that timestamp averaging is fixed; docs note the real-cluster p99 smoke cannot catch a disabled producer cap at that size.
cluster_transaction_testadds a deterministichold_pipelineregression (global in-flight budget pause, staged drain, resume after reply). Monitor helpers pass--authenticatewhen the env has a password.New
test_short_run_stats.py: 200-request real-server smoke checks JSON Count, zero connection errors, 200 server SETs, and positive Ops/sec; exact rounding stays in C++.Reviewed by Cursor Bugbot for commit 24c3ac6. Bugbot is set up for automated code reviews on this repo. Configure here.