Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Fix race in test expectations
Browse files Browse the repository at this point in the history
Can be commit and sync, we only care about sync.
  • Loading branch information
rndstr committed Aug 14, 2018
1 parent 1bf1235 commit 8858231
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions daemon/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,15 @@ func TestDaemon_NotifyChange(t *testing.T) {
}

// Check that history was written to
var e []event.Event
w.Eventually(func() bool {
e, _ = events.AllEvents(time.Time{}, -1, time.Time{})
return len(e) > 0
}, "Waiting for new events")
if 1 != len(e) {
t.Fatal("Expected one log event from the sync, but got", len(e))
} else if event.EventSync != e[0].Type {
t.Fatalf("Expected event with type %s but got %s", event.EventSync, e[0].Type)
}
es, _ := events.AllEvents(time.Time{}, -1, time.Time{})
for _, e := range es {
if e.Type == event.EventSync {
return true
}
}
return false
}, "Waiting for new sync events")
}

// When I perform a release, it should add a job to update git to the queue
Expand Down

0 comments on commit 8858231

Please sign in to comment.