mirror of
https://github.com/multipleof4/ntfy.git
synced 2026-10-16 16:37:55 +00:00
Fix flaky test
This commit is contained in:
@@ -235,13 +235,12 @@ func TestServer_WebPush_Publish_RemoveOnError(t *testing.T) {
|
|||||||
|
|
||||||
request(t, s, "POST", "/test-topic", "web push test", nil)
|
request(t, s, "POST", "/test-topic", "web push test", nil)
|
||||||
|
|
||||||
waitFor(t, func() bool {
|
|
||||||
return received.Load()
|
|
||||||
})
|
|
||||||
|
|
||||||
// Receiving the 410 should've caused the publisher to expire all subscriptions on the endpoint
|
// Receiving the 410 should've caused the publisher to expire all subscriptions on the endpoint
|
||||||
|
waitFor(t, func() bool {
|
||||||
requireSubscriptionCount(t, s, "test-topic", 0)
|
subs, err := s.webPush.SubscriptionsForTopic("test-topic")
|
||||||
|
require.Nil(t, err)
|
||||||
|
return len(subs) == 0
|
||||||
|
})
|
||||||
requireSubscriptionCount(t, s, "test-topic-abc", 0)
|
requireSubscriptionCount(t, s, "test-topic-abc", 0)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user