From 79d06184abb33d28ed05cc2a2832df209aa287f7 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Fri, 11 Aug 2023 10:46:22 +0200 Subject: [PATCH] fix flaky test, event doesn't have to be set --- webaccount/account_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webaccount/account_test.go b/webaccount/account_test.go index 690e740..b5f0b6a 100644 --- a/webaccount/account_test.go +++ b/webaccount/account_test.go @@ -8,6 +8,7 @@ import ( "context" "encoding/base64" "encoding/json" + "fmt" "io" "mime/multipart" "net/http" @@ -122,6 +123,9 @@ func TestAccount(t *testing.T) { loop: for { e := <-l.Events + if e.Event == nil { + continue + } switch x := e.Event.(type) { case importCount: count += x.Count @@ -132,7 +136,7 @@ func TestAccount(t *testing.T) { case importAborted: t.Fatalf("unexpected aborted import") default: - panic("missing case") + panic(fmt.Sprintf("missing case for Event %#v", e)) } } if count != expect {