Skip to content

Commit

Permalink
Fix background ping test edgecase (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
HDegroote authored Oct 15, 2024
1 parent c9504dd commit 753aabe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/announces.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ test('announcer background does not over-trigger', async function (t) {
// give some time for possible background spam
await new Promise(resolve => setTimeout(resolve, 500))

const requestsSent = initTid > 65536 - 50
const requestsSent = initTid > a.io._tid // it wrapped?
? a.io._tid // close enough for this test (ignoring those before wrapping)
: a.io._tid - initTid

t.ok(
requestsSent < 50,
'No background spam of ping requests'
`No background spam of ping requests (saw ${requestsSent})`
)

await a.destroy()
Expand Down

0 comments on commit 753aabe

Please sign in to comment.