Unverified Commit ef282bd7 authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Fix timing issue in replication test (#11611)

There is a timing issue in the test, happens with valgrind:
```
*** [err]: diskless fast replicas drop during rdb pipe in tests/integration/replication.tcl
log message of '"*Loading DB in memory*"' not found in ./tests/tmp/server.3580.246/stdout after line: 0 till line: 39
```

The server logs:
```
43465:S 03 Dec 2022 01:26:25.664 * Trying a partial resynchronization (request 15155fa24af0539b70428f9b41f4f7129d774560:1).
43465:S 03 Dec 2022 01:26:35.133 * Full resync from master: 8ddf5a3f7c8ca1061c6b29aa84e7c985c5b29c61:680
```

From the logs, we can see it took almost 10s to get full resync response,
happens with valgrind. it's extremely slow. So i guess it's just an
insufficient wait_for_condition timeout.

Set the time to 15s, and modify other similar places at the same time.
parent b56bb720
...@@ -857,7 +857,7 @@ start_server {tags {"repl external:skip"}} { ...@@ -857,7 +857,7 @@ start_server {tags {"repl external:skip"}} {
# wait for the replicas to start reading the rdb # wait for the replicas to start reading the rdb
# using the log file since the replica only responds to INFO once in 2mb # using the log file since the replica only responds to INFO once in 2mb
wait_for_log_messages -1 {"*Loading DB in memory*"} 0 800 10 wait_for_log_messages -1 {"*Loading DB in memory*"} 0 1500 10
if {$measure_time} { if {$measure_time} {
set master_statfile "/proc/$master_pid/stat" set master_statfile "/proc/$master_pid/stat"
...@@ -990,7 +990,7 @@ test "diskless replication child being killed is collected" { ...@@ -990,7 +990,7 @@ test "diskless replication child being killed is collected" {
$replica replicaof $master_host $master_port $replica replicaof $master_host $master_port
# wait for the replicas to start reading the rdb # wait for the replicas to start reading the rdb
wait_for_log_messages 0 {"*Loading DB in memory*"} $loglines 800 10 wait_for_log_messages 0 {"*Loading DB in memory*"} $loglines 1500 10
# wait to be sure the replica is hung and the master is blocked on write # wait to be sure the replica is hung and the master is blocked on write
after 500 after 500
...@@ -1075,7 +1075,7 @@ test "diskless replication read pipe cleanup" { ...@@ -1075,7 +1075,7 @@ test "diskless replication read pipe cleanup" {
$replica replicaof $master_host $master_port $replica replicaof $master_host $master_port
# wait for the replicas to start reading the rdb # wait for the replicas to start reading the rdb
wait_for_log_messages 0 {"*Loading DB in memory*"} $loglines 800 10 wait_for_log_messages 0 {"*Loading DB in memory*"} $loglines 1500 10
set loglines [count_log_lines -1] set loglines [count_log_lines -1]
# send FLUSHALL so the RDB child will be killed # send FLUSHALL so the RDB child will be killed
......
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