From 363c0f67b9bd295dbe08815497e8b0b084440139 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 7 Oct 2015 22:32:24 +0200 Subject: [PATCH] Test: fix attach_to_replication_stream to handle newlines. --- tests/test_helper.tcl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl index df7d17e92..d600abf0a 100644 --- a/tests/test_helper.tcl +++ b/tests/test_helper.tcl @@ -470,8 +470,11 @@ proc attach_to_replication_stream {} { flush $s # Get the count - set count [gets $s] - set prefix [string range $count 0 0] + while 1 { + set count [gets $s] + set prefix [string range $count 0 0] + if {$prefix ne {}} break; # Newlines are allowed as PINGs. + } if {$prefix ne {$}} { error "attach_to_replication_stream error. Received '$count' as count." }