Skip to content

Commit

Permalink
fix all udx leaks in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Oct 5, 2024
1 parent a3681fd commit 7dcd252
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/replicate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,9 @@ test('cancel block', async function (t) {

t.ok(a.replicator.stats.wireCancel.rx > 0, 'wireCancel stats incremented')
t.is(a.replicator.stats.wireCancel.rx, b.replicator.stats.wireCancel.tx, 'wireCancel stats consistent')

n1.destroy()
n2.destroy()
})

test('try cancel block from a different session', async function (t) {
Expand Down Expand Up @@ -1378,6 +1381,9 @@ test('try cancel block from a different session', async function (t) {

await a.close()
await b.close()

n1.destroy()
n2.destroy()
})

test('retry failed block requests to another peer', async function (t) {
Expand Down Expand Up @@ -1415,6 +1421,15 @@ test('retry failed block requests to another peer', async function (t) {

t.alike(await c.get(0), b4a.from('1'))

n1.destroy()
n2.destroy()

n3.destroy()
n4.destroy()

n5.destroy()
n6.destroy()

async function onupload (core, name) {
t.pass('onupload: ' + name + ' (' + (once ? 'allow' : 'deny') + ')')

Expand Down Expand Up @@ -1626,6 +1641,9 @@ test('session id reuse does not stall', async function (t) {

t.pass('All blocks downloaded')
t.is(downloaded, 100, 'Downloaded all blocks exactly once')

n1.destroy()
n2.destroy()
})

test('restore after cancelled block request', async function (t) {
Expand Down Expand Up @@ -1654,6 +1672,9 @@ test('restore after cancelled block request', async function (t) {
await new Promise(resolve => b.on('append', resolve))

t.is(b.length, a.length)

n1.destroy()
n2.destroy()
})

test('handshake is unslabbed', async function (t) {
Expand Down

0 comments on commit 7dcd252

Please sign in to comment.