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

Commit

Permalink
fix: flaky engine peer tagging test (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc authored Mar 10, 2020
1 parent 964888c commit f8ed752
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/decision/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1007,9 +1007,9 @@ func TestTaggingPeers(t *testing.T) {
}

func TestTaggingUseful(t *testing.T) {
peerSampleInterval := 5 * time.Millisecond
peerSampleInterval := 10 * time.Millisecond

ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 5*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(8 * time.Millisecond)
time.Sleep(15 * 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 f8ed752

Please sign in to comment.