From 7706bd9845302f4495ab8fc3dc38a5c295aa7947 Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Wed, 8 Feb 2023 20:00:10 -0500 Subject: [PATCH] Fix racing test --- server/server_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server/server_test.go b/server/server_test.go index aa7a2049..40a5bcbb 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -129,6 +129,7 @@ func TestServer_PublishAndSubscribe(t *testing.T) { publishFirstRR := request(t, s, "PUT", "/mytopic", "my first message", nil) require.Equal(t, 200, publishFirstRR.Code) + time.Sleep(500 * time.Millisecond) // Publishing is done asynchronously, this avoids races publishSecondRR := request(t, s, "PUT", "/mytopic", "my other message", map[string]string{ "Title": " This is a title ",