Unverified Commit 437e2583 authored by Oran Agra's avatar Oran Agra Committed by GitHub
Browse files

Fix rare test failures due to repl-ping-replica-period (#8393)

some tests use attach_to_replication_stream to watch what's propagated
to replicas, but in some cases the periodic ping may slip in and fail
the test.
we disable that ping by setting the period to once an hour (tests should
not run for that long).

other change is so that the next time this oom-score-adj test fails,
we'll see the value (assert_equals prints it)
parent f2258915
...@@ -717,6 +717,7 @@ if {[llength $filtered_tests] < [llength $::all_tests]} { ...@@ -717,6 +717,7 @@ if {[llength $filtered_tests] < [llength $::all_tests]} {
} }
proc attach_to_replication_stream {} { proc attach_to_replication_stream {} {
r config set repl-ping-replica-period 3600
if {$::tls} { if {$::tls} {
set s [::tls::socket [srv 0 "host"] [srv 0 "port"]] set s [::tls::socket [srv 0 "host"] [srv 0 "port"]]
} else { } else {
...@@ -774,6 +775,7 @@ proc assert_replication_stream {s patterns} { ...@@ -774,6 +775,7 @@ proc assert_replication_stream {s patterns} {
proc close_replication_stream {s} { proc close_replication_stream {s} {
close $s close $s
r config set repl-ping-replica-period 10
} }
# With the parallel test running multiple Redis instances at the same time # With the parallel test running multiple Redis instances at the same time
......
...@@ -39,7 +39,7 @@ if {$system_name eq {linux}} { ...@@ -39,7 +39,7 @@ if {$system_name eq {linux}} {
r bgsave r bgsave
set child_pid [get_child_pid 0] set child_pid [get_child_pid 0]
assert {[get_oom_score_adj $child_pid] == [expr $base + 30]} assert_equal [get_oom_score_adj $child_pid] [expr $base + 30]
} }
# Failed oom-score-adj tests can only run unprivileged # Failed oom-score-adj tests can only run unprivileged
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment