Skip to content

MOD-18948: don't start a replica under --use-aof in test_replication - #1662

Merged
LiranAbir merged 3 commits into
masterfrom
MOD-18948-json-skip-aof
Oct 8, 2026
Merged

LiranAbir merged 3 commits into
masterfrom
MOD-18948-json-skip-aof

Conversation

@LiranAbir

@LiranAbir LiranAbir commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

MOD-18948 — follow-up to #1656.

Why

Two of the three nightly failures since #1656 are the same hang, in the --use-aof env group, after test_replication had already passed:

Night Leg Log
09-30 x64-bionic 36773272648
10-01 x64-rocky10 36922500124
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, also 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.

The third failure (09-30 x64-bionic, general group: json.strappend: replica did not ack the write within 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

  • testWriteCommandsReplicate skips under AOF, before it builds the replica env. Replication stays covered by the general and --use-slaves groups; AOF is irrelevant to what it checks.
  • 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.

Verification

Locally, all four tests.sh variants:

Variant Result Replicas started by test_replication
general 2 passed 1
--use-slaves 2 passed 2 (the group's own)
--use-aof coverage passed, replication skipped 0
--env oss-cluster coverage passed, replication skipped 0

The hang itself doesn't reproduce locally (the replica exits in ~0.1 s here), so the proof is that the --use-aof group 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-aof group by avoiding replica processes that don’t exit on SIGTERM.

testWriteCommandsReplicate now calls env.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.

testEveryWriteCommandIsCovered no longer uses useSlaves=True—it only inspects the module command table via COMMAND, 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.

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]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 504a096. Configure here.

@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.22%. Comparing base (e7806af) to head (90f0b62).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gabsow gabsow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving: traceback in the description makes the cause clear and the fix matches Bloom/TS. Comment below is non-blocking.

Comment on lines 108 to +110
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).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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.

@LiranAbir
LiranAbir merged commit d382e22 into master Oct 8, 2026
18 checks passed
@LiranAbir
LiranAbir deleted the MOD-18948-json-skip-aof branch October 8, 2026 10:51
@gabsow gabsow mentioned this pull request Oct 12, 2026
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.

2 participants