From 329fdc40a84190c7cab6e462003809d9ed41a8e1 Mon Sep 17 00:00:00 2001 From: Frank Schroeder Date: Fri, 20 Oct 2017 06:41:49 +0200 Subject: [PATCH] local state: make test more robust --- agent/local/state_test.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/agent/local/state_test.go b/agent/local/state_test.go index d40300a4c..a697162f7 100644 --- a/agent/local/state_test.go +++ b/agent/local/state_test.go @@ -1036,14 +1036,12 @@ func TestAgent_UpdateCheck_DiscardOutput(t *testing.T) { if err := a.State.AddCheck(check, ""); err != nil { t.Fatalf("bad: %s", err) } - - // wait until the check is in sync - retry.Run(t, func(r *retry.R) { - if inSync("web") { - return - } - r.FailNow() - }) + if err := a.State.SyncFull(); err != nil { + t.Fatal("bad: %s", err) + } + if !inSync("web") { + t.Fatal("check should be in sync") + } // update the check with the same status but different output // and the check should still be in sync.