fix flaky test, event doesn't have to be set

This commit is contained in:
Mechiel Lukkien 2023-08-11 10:46:22 +02:00
parent 55d05c6bea
commit 79d06184ab
No known key found for this signature in database

View file

@ -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 {