local state: make test more robust

This commit is contained in:
Frank Schroeder 2017-10-20 06:41:49 +02:00 committed by Frank Schröder
parent e16c8f3982
commit 779bf04aa3
1 changed files with 6 additions and 8 deletions

View File

@ -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
if err := a.State.SyncFull(); err != nil {
t.Fatal("bad: %s", err)
}
if !inSync("web") {
t.Fatal("check should be in sync")
}
r.FailNow()
})
// update the check with the same status but different output
// and the check should still be in sync.