From 8fb89a572892e600146bd933c4f8f99d46a519c7 Mon Sep 17 00:00:00 2001 From: nitaicaro <42576749+nitaicaro@users.noreply.github.com> Date: Wed, 30 Sep 2020 19:52:01 +0300 Subject: [PATCH] =?UTF-8?q?Fixed=20Tracking=20test=20=E2=80=9CThe=20other?= =?UTF-8?q?=20connection=20is=20able=20to=20get=20invalidations=E2=80=9D?= =?UTF-8?q?=20(#7871)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PROBLEM: [$rd1 read] reads invalidation messages one by one, so it's never going to see the second invalidation message produced after INCR b, whether or not it exists. Adding another read will block incase no invalidation message is produced. FIX: We switch the order of "INCR a" and "INCR b" - now "INCR b" comes first. We still only read the first invalidation message produces. If an invalidation message is wrongly produces for b - then it will be produced before that of a, since "INCR b" comes before "INCR a". Co-authored-by: Nitai Caro --- tests/unit/tracking.tcl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/tracking.tcl b/tests/unit/tracking.tcl index 0332fa726..839b894ea 100644 --- a/tests/unit/tracking.tcl +++ b/tests/unit/tracking.tcl @@ -16,9 +16,10 @@ start_server {tags {"tracking"}} { test {The other connection is able to get invalidations} { r SET a 1 + r SET b 1 r GET a - r INCR a - r INCR b ; # This key should not be notified, since it wasn't fetched. + r INCR b ; # This key should not be notified, since it wasn't fetched. + r INCR a set keys [lindex [$rd1 read] 2] assert {[llength $keys] == 1} assert {[lindex $keys 0] eq {a}}