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

Commit

Permalink
Merge pull request #480 from ipfs/fix/deflake-tag-test
Browse files Browse the repository at this point in the history
test: deflake engine test
  • Loading branch information
Stebalien authored Apr 30, 2021
2 parents 038c893 + 1198579 commit 6ea1681
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/decision/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1058,18 +1058,18 @@ func TestTaggingUseful(t *testing.T) {
msg.AddBlock(block)

for i := 0; i < 3; i++ {
if me.PeerTagger.count(me.Engine.tagUseful) != 0 {
t.Fatal("Peers should be untagged but weren't")
if untagged := me.PeerTagger.count(me.Engine.tagUseful); untagged != 0 {
t.Fatalf("%d peers should be untagged but weren't", untagged)
}

me.Engine.MessageSent(friend, msg)

for j := 0; j < 3; j++ {
for j := 0; j < 2; j++ {
<-sampleCh
}

if me.PeerTagger.count(me.Engine.tagUseful) != 1 {
t.Fatal("Peers should be tagged but weren't")
if tagged := me.PeerTagger.count(me.Engine.tagUseful); tagged != 1 {
t.Fatalf("1 peer should be tagged, but %d were", tagged)
}

for j := 0; j < longTermRatio; j++ {
Expand Down

0 comments on commit 6ea1681

Please sign in to comment.