Skip to content

Commit

Permalink
Pass custom stream
Browse files Browse the repository at this point in the history
  • Loading branch information
LuKks committed Jul 24, 2023
1 parent 6173938 commit 6f64145
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/replicate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1172,15 +1172,18 @@ test('try cancel block from a different session', async function (t) {
})

test.solo('closing last session should stop replication', async function (t) {
t.plan(5)
t.plan(7)

const a = await create()
await a.append(['a', 'b', 'c'])

const b = await create(a.key)

const sessionA = a.session()
const [s1, s2] = replicate(sessionA, b, t)

const [n1, n2] = makeStreamPair(t, { latency: [0, 0] })
const s1 = a.replicate(n1)
const s2 = b.replicate(n2)

t.alike(await b.get(0), b4a.from('a'))
t.alike(await b.get(1), b4a.from('b'))
Expand All @@ -1189,6 +1192,9 @@ test.solo('closing last session should stop replication', async function (t) {
// await a.close()
// await new Promise(resolve => setTimeout(resolve, 500))

t.is(n2.destroying, false)
t.is(n2.destroying, false)

t.is(s1.destroying, false)
t.is(s2.destroying, false)

Expand Down

0 comments on commit 6f64145

Please sign in to comment.