lib/sync: Cleanly fail instead of panic in tests (#6088)

This commit is contained in:
Simon Frei 2019-10-16 10:11:11 +02:00 committed by GitHub
parent b8907b49f9
commit 1a06ab68eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,8 +152,7 @@ func TestRWMutex(t *testing.T) {
if len(messages) != 2 { if len(messages) != 2 {
t.Errorf("Unexpected message count") t.Errorf("Unexpected message count")
} } else if !strings.Contains(messages[1], "RUnlockers while locking:\nat sync") || !strings.Contains(messages[1], "sync_test.go:") {
if !strings.Contains(messages[1], "RUnlockers while locking:\nat sync") || !strings.Contains(messages[1], "sync_test.go:") {
t.Error("Unexpected message") t.Error("Unexpected message")
} }