From 1198579780a5d65a00ed93cfcaa0000c486a8757 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 30 Apr 2021 11:15:06 -0700 Subject: [PATCH] test: deflake engine test --- internal/decision/engine_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/decision/engine_test.go b/internal/decision/engine_test.go index 5c547ffe..2cf9e773 100644 --- a/internal/decision/engine_test.go +++ b/internal/decision/engine_test.go @@ -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++ {