From 88a77cb1323ea7a8b85fd1b18c80ad24aaf2adca Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Fri, 8 Jul 2022 10:16:23 -0400 Subject: [PATCH] Fix race --- server/server_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/server_test.go b/server/server_test.go index 1634d8d..d68cfa1 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -66,6 +66,8 @@ func TestServer_PublishWithFirebase(t *testing.T) { msg1 := toMessage(t, response.Body.String()) require.NotEmpty(t, msg1.ID) require.Equal(t, "my first message", msg1.Message) + + time.Sleep(100 * time.Millisecond) // Firebase publishing happens require.Equal(t, 1, len(sender.Messages())) require.Equal(t, "my first message", sender.Messages()[0].Data["message"]) require.Equal(t, "my first message", sender.Messages()[0].APNS.Payload.Aps.Alert.Body)