Explorar o código

Fix racing test

binwiederhier %!s(int64=3) %!d(string=hai) anos
pai
achega
7706bd9845
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      server/server_test.go

+ 1 - 0
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 ",