Repository navigation
MOD-18948: don't start a replica under --use-aof in test_replication - #1662
Conversation
Two of the three nightly failures since #1656 are the same hang, in the --use-aof env group, after test_replication had already passed: 09-30 x64-bionic and 10-01 x64-rocky10: test_replication:testEveryWriteCommandIsCovered [PASS] Test Timeout, printing trace. redis_std.py stopEnv -> _stopProcess(SLAVE) -> process.communicate() RLTest sends SIGTERM to the test's replica, waits 30 s, then calls communicate() with no timeout; the replica, running with AOF, did not exit. The hang predates this test -- test_mset_replication_in_aof hits it too, with a replica running AOF -- but in the --use-aof group no other test starts a replica, so test_replication is what brings one in. Raising the WAIT timeout would not help: the test itself passes. - testWriteCommandsReplicate skips under AOF, before it builds the replica env. Replication stays covered by the general and --use-slaves groups. - testEveryWriteCommandIsCovered no longer asks for a replica at all: it only reads the command table, and it is the test whose teardown hung on both legs. Locally, every tests.sh variant passes, and under --use-aof no replica is started any more. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 504a096. Configure here.
| # Under --use-aof the replica below would run with AOF, and RLTest intermittently hangs | ||
| # stopping such a replica (it ignores SIGTERM; RLTest then waits on it with no timeout). | ||
| # Replication is covered by the other env groups, so skip rather than add it here. | ||
| env.skipOnAOF() |
There was a problem hiding this comment.
AOF skip uses unknown Env helper
High Severity
testWriteCommandsReplicate calls env.skipOnAOF() before building the replica env. This suite skips AOF by checking env.useAof and calling env.skip(), and skipOnAOF is not used anywhere else. If Env has no such helper, the replication test errors in every non-cluster group instead of skipping under --use-aof and running in general and --use-slaves.
Reviewed by Cursor Bugbot for commit 504a096. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1662 +/- ##
=======================================
Coverage 88.22% 88.22%
=======================================
Files 17 17
Lines 6063 6063
=======================================
Hits 5349 5349
Misses 714 714 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gabsow
left a comment
There was a problem hiding this comment.
Approving: traceback in the description makes the cause clear and the fix matches Bloom/TS. Comment below is non-blocking.
| env.skipOnCluster() # a cluster env has no replica connection to read | ||
| # Under --use-aof the replica below would run with AOF, and RLTest intermittently hangs | ||
| # stopping such a replica (it ignores SIGTERM; RLTest then waits on it with no timeout). |
There was a problem hiding this comment.
"ignores SIGTERM" is stronger than what the evidence shows (the replica did not exit within RLTest's 30s wait). Suggest "does not exit" and, ideally, a link to a follow-up ticket for the RLTest fix (SIGKILL fallback / communicate(timeout=...)), since this skip only avoids the hang here and e.g. JSON's test_mset_replication_in_aof is still exposed.


MOD-18948 — follow-up to #1656.
Why
Two of the three nightly failures since #1656 are the same hang, in the
--use-aofenv group, aftertest_replicationhad already passed:x64-bionicx64-rocky10RLTest sends SIGTERM to the test's replica, waits 30 s, then calls
communicate()with no timeout — the replica, running with AOF, did not exit. The hang predates this test (test_mset_replication_in_aofhits it too, also with a replica running AOF), but in the--use-aofgroup no other test starts a replica, sotest_replicationis what brings one in. Raising theWAITtimeout would not help: the test itself passes.The third failure (09-30
x64-bionic,generalgroup:json.strappend: replica did not ack the writewithin 1 s) is a single occurrence in four nights. The run's artifacts carry no server logs, so whether that was a slow runner or a dropped link can't be told; it's left alone here.What
testWriteCommandsReplicateskips under AOF, before it builds the replica env. Replication stays covered by thegeneraland--use-slavesgroups; AOF is irrelevant to what it checks.testEveryWriteCommandIsCoveredno longer asks for a replica at all: it only reads the command table, and it is the test whose teardown hung on both legs.Verification
Locally, all four
tests.shvariants:test_replication--use-slaves--use-aof--env oss-clusterThe hang itself doesn't reproduce locally (the replica exits in ~0.1 s here), so the proof is that the
--use-aofgroup no longer has a replica to get stuck on.🤖 Generated with Claude Code
Note
Low Risk
Test-only changes; no production or replication behavior is modified.
Overview
Fixes intermittent RLTest teardown hangs in the
--use-aofgroup by avoiding replica processes that don’t exit on SIGTERM.testWriteCommandsReplicatenow callsenv.skipOnAOF()(with rationale in comments) before creating a master/replica env, since replication is already exercised in other env groups and AOF isn’t relevant to the assertions.testEveryWriteCommandIsCoveredno longer usesuseSlaves=True—it only inspects the module command table viaCOMMAND, so starting a replica was unnecessary and was the teardown path that hung under AOF.Reviewed by Cursor Bugbot for commit 90f0b62. Bugbot is set up for automated code reviews on this repo. Configure here.