Skip to content

Allow the in-flight drain in the staircase test-time exit check - #838

Merged
fcostaoliveira merged 2 commits into
masterfrom
claude/staircase-drain-bound-20261024
Oct 24, 2026
Merged

fcostaoliveira merged 2 commits into
masterfrom
claude/staircase-drain-bound-20261024

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

test_staircase_exits_at_test_time (added in a7881e0, #742, for #728) bounds each worker thread's lifetime at --test-time + 0.5 s. A worker still waits for the replies that are in flight at the deadline (up to TEST_TIME_DRAIN_GRACE_SECS, client.cpp:420-460), so a slow reply legitimately extends it.

On #828's CI run, job "TSAN OSS-CLUSTER API: TCP Plaintext (shard 2/2)" (job 120857056533) failed the --test-time 2 --step-duration 20 case: the worker ran 3.096 s. The progress lines show one thread still alive at 155% with one more op completing, and the GET histogram's maximum is 1097.727 ms: one reply took 1.1 s on the loaded TSan runner, and the thread waited for it as designed.

In the last 40 runs each of tsan.yml, asan.yml, ubsan.yml and ci.yml, this is the only failure of the test.

Change

Also allow the slowest reply that arrived after the deadline: the maximum Max Latency of the Totals Time-Serie seconds from --test-time on, so thread_wall < test_time + 0.5 + drain. An earlier slow reply does not widen the bound (from review: with the whole run's Max Latency, one 300-700 ms pause at 0.8 s let a worker that idled 0.6-1 s past the deadline pass). The message now prints the bound and the drain.

Reproduced locally with CLIENT PAUSE 1200 ALL at 1.8 s of a --test-time 2 staircase run: workers ran 2.99-3.07 s, the paused replies landed in Time-Serie second 2 or 3, and the run passes the new bound (fails the old one).

The #728 bug left the event loop idle until the next step tick with nothing in flight, so it still fails. With a binary built from a7881e0^ (before the fix), standalone and 3-shard cluster:

Case Worker ran Slowest reply Result
--test-time 2 --step-duration 20 20.002 s 0.002 s FAIL
--test-time 5 --step-duration 2 6.005 s 0.004-0.005 s FAIL
--test-time 5 --step-duration 3 6.004 s 0.007 s FAIL

On current master's code the test passes standalone and on a 3-shard cluster. The failed CI run (3.096 s, slowest reply 1.098 s) is inside the new bound of 3.598 s.

Affected versions

Test only, master only: no release tag contains a7881e0.

🤖 Generated with Claude Code

fcostaoliveira and others added 2 commits October 24, 2026 17:08
test_staircase_exits_at_test_time bounded each worker's lifetime at
--test-time + 0.5 s. A worker still waits for the replies in flight at
the deadline, and on a TSan cluster runner one GET took 1.1 s, so the
check failed although memtier behaved as designed. Also allow the run's
slowest reply. The #728 bug idled until the next step with nothing in
flight, so it still fails: 20.0 s and 6.0 s with a 2-5 ms slowest reply.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…heck

Take the slowest reply from the Time-Serie seconds from --test-time on,
not the whole run: an early slow reply no longer widens the bound, so a
worker that idles past the deadline still fails. Print the bound, and
name the (2, 20) case as the #728 guard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@fcostaoliveira
fcostaoliveira merged commit 417c1b4 into master Oct 24, 2026
170 of 171 checks passed
fcostaoliveira added a commit that referenced this pull request Oct 24, 2026
Picks up #838, the staircase drain bound that failed this branch's TSan
cluster job.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fcostaoliveira added a commit that referenced this pull request Oct 24, 2026
Picks up #828 (TSan crash tests signal only while the main thread
sleeps), which fixes this branch's red TSan crash-handler job, and #838.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fcostaoliveira added a commit that referenced this pull request Oct 24, 2026
Picks up #812, the reconnect deadline-clock fix for the never-started
client test that failed this branch's plaintext job, plus #828, #838 and
#841.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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