More flakey tests

This commit is contained in:
Till Faelligen 2022-12-22 13:04:32 +01:00
parent d1d2d16738
commit 09dff951d6
No known key found for this signature in database
GPG key ID: ACCDC9606D472758

View file

@ -157,11 +157,11 @@ func TestOutboundPeeking(t *testing.T) {
if len(outboundPeeks) != len(peekIDs) { if len(outboundPeeks) != len(peekIDs) {
t.Fatalf("inserted %d peeks, selected %d", len(peekIDs), len(outboundPeeks)) t.Fatalf("inserted %d peeks, selected %d", len(peekIDs), len(outboundPeeks))
} }
for i := range outboundPeeks { gotPeekIDs := make([]string, 0, len(outboundPeeks))
if outboundPeeks[i].PeekID != peekIDs[i] { for _, p := range outboundPeeks {
t.Fatalf("unexpected peek ID: %s, want %s", outboundPeeks[i].PeekID, peekIDs[i]) gotPeekIDs = append(gotPeekIDs, p.PeekID)
}
} }
assert.ElementsMatch(t, gotPeekIDs, peekIDs)
}) })
} }
@ -239,10 +239,10 @@ func TestInboundPeeking(t *testing.T) {
if len(inboundPeeks) != len(peekIDs) { if len(inboundPeeks) != len(peekIDs) {
t.Fatalf("inserted %d peeks, selected %d", len(peekIDs), len(inboundPeeks)) t.Fatalf("inserted %d peeks, selected %d", len(peekIDs), len(inboundPeeks))
} }
for i := range inboundPeeks { gotPeekIDs := make([]string, 0, len(inboundPeeks))
if inboundPeeks[i].PeekID != peekIDs[i] { for _, p := range inboundPeeks {
t.Fatalf("unexpected peek ID: %s, want %s", inboundPeeks[i].PeekID, peekIDs[i]) gotPeekIDs = append(gotPeekIDs, p.PeekID)
}
} }
assert.ElementsMatch(t, gotPeekIDs, peekIDs)
}) })
} }