mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-25 01:03:09 +00:00
Adjust store test rate limit to eliminate CI test flakyness of timing - lightpush/legacy_lightpush/filter
This commit is contained in:
parent
73b5cc9654
commit
608fd9dac6
@ -122,15 +122,15 @@ suite "Waku Filter - DOS protection":
|
||||
check client2.subscribe(serverRemotePeerInfo, pubsubTopic, contentTopicSeq) ==
|
||||
none(FilterSubscribeErrorKind)
|
||||
|
||||
await sleepAsync(20.milliseconds)
|
||||
await sleepAsync(5.milliseconds)
|
||||
check client1.subscribe(serverRemotePeerInfo, pubsubTopic, contentTopicSeq) ==
|
||||
none(FilterSubscribeErrorKind)
|
||||
check client2.subscribe(serverRemotePeerInfo, pubsubTopic, contentTopicSeq) ==
|
||||
none(FilterSubscribeErrorKind)
|
||||
await sleepAsync(20.milliseconds)
|
||||
await sleepAsync(5.milliseconds)
|
||||
check client1.subscribe(serverRemotePeerInfo, pubsubTopic, contentTopicSeq) ==
|
||||
none(FilterSubscribeErrorKind)
|
||||
await sleepAsync(20.milliseconds)
|
||||
await sleepAsync(5.milliseconds)
|
||||
check client1.subscribe(serverRemotePeerInfo, pubsubTopic, contentTopicSeq) ==
|
||||
some(FilterSubscribeErrorKind.TOO_MANY_REQUESTS)
|
||||
check client2.subscribe(serverRemotePeerInfo, pubsubTopic, contentTopicSeq) ==
|
||||
@ -170,14 +170,14 @@ suite "Waku Filter - DOS protection":
|
||||
|
||||
# After another ~500ms, ~1 token refilled; PING consumes 1 => expected remaining: 2
|
||||
|
||||
await sleepAsync(50.milliseconds)
|
||||
await sleepAsync(10.milliseconds)
|
||||
check client1.unsubscribe(serverRemotePeerInfo, pubsubTopic, contentTopicSeq) ==
|
||||
none(FilterSubscribeErrorKind)
|
||||
check wakuFilter.subscriptions.isSubscribed(client1.clientPeerId) == false
|
||||
|
||||
# ~50ms is not enough to refill a token at 3/sec; UNSUBSCRIBE consumes 1 => expected remaining: 1
|
||||
# ~10ms is not enough to refill a token at 3/sec; UNSUBSCRIBE consumes 1 => expected remaining: 1
|
||||
|
||||
await sleepAsync(50.milliseconds)
|
||||
await sleepAsync(10.milliseconds)
|
||||
check client1.ping(serverRemotePeerInfo) == some(FilterSubscribeErrorKind.NOT_FOUND)
|
||||
# PING consumes the last token => expected remaining: 0
|
||||
|
||||
|
||||
@ -124,7 +124,7 @@ suite "Rate limited push service":
|
||||
|
||||
for testCnt in 0 .. 2:
|
||||
await successProc()
|
||||
await sleepAsync(20.millis)
|
||||
await sleepAsync(5.millis)
|
||||
|
||||
await rejectProc()
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ suite "Rate limited push service":
|
||||
|
||||
for testCnt in 0 .. 2:
|
||||
await successProc()
|
||||
await sleepAsync(20.millis)
|
||||
await sleepAsync(5.millis)
|
||||
|
||||
await rejectProc()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user