From 0816ea8ecb48d2b1b988026f135e6fe28b7bcc09 Mon Sep 17 00:00:00 2001 From: Cody Soyland Date: Tue, 31 Jul 2018 12:11:21 -0500 Subject: [PATCH] Add sleep to test to wait for key replication --- server/handler_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/handler_test.go b/server/handler_test.go index 954523e04..5617c8ffa 100644 --- a/server/handler_test.go +++ b/server/handler_test.go @@ -24,6 +24,7 @@ import ( "reflect" "strings" "testing" + "time" gohttp "net/http" @@ -675,6 +676,9 @@ func TestClusterTranslator(t *testing.T) { test.MustDo("POST", cluster[0].URL()+"/index/i0/query", "Set(\"foo\", f0=\"bar\")") + // wait for key to replicate to second node + time.Sleep(100 * time.Millisecond) + result0 := test.MustDo("POST", cluster[0].URL()+"/index/i0/query", "Row(f0=\"bar\")").Body result1 := test.MustDo("POST", cluster[1].URL()+"/index/i0/query", "Row(f0=\"bar\")").Body