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

Commit

Permalink
test: deflake engine test
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Apr 30, 2021
1 parent 038c893 commit 1198579
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 1198579

Please sign in to comment.