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

Commit

Permalink
fix: flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc committed Mar 6, 2020
1 parent 2e60342 commit 568a984
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/decision/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ func TestTaggingPeers(t *testing.T) {
func TestTaggingUseful(t *testing.T) {
peerSampleInterval := 5 * time.Millisecond

ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
me := newTestEngine(ctx, "engine", peerSampleInterval)
friend := peer.ID("friend")
Expand All @@ -1023,7 +1023,7 @@ func TestTaggingUseful(t *testing.T) {
t.Fatal("Peers should be untagged but weren't")
}
me.Engine.MessageSent(friend, msg)
time.Sleep(peerSampleInterval * 2)
time.Sleep(8 * time.Millisecond)
if me.PeerTagger.count(me.Engine.tagUseful) != 1 {
t.Fatal("Peers should be tagged but weren't")
}
Expand Down

0 comments on commit 568a984

Please sign in to comment.