Skip to content

Commit ddf5fdd

Browse files
committed
[DO NOT MERGE] add debug logs
1 parent 4b6bdbf commit ddf5fdd

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/replicate.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,7 @@ for (let i = 0; i < 500; i++) {
12261226
const b = await create(a.key)
12271227

12281228
await a.append(['a', 'b', 'c'])
1229+
console.log('appended blocks')
12291230

12301231
const [n1, n2] = makeStreamPair(t, { latency: [50, 50] })
12311232
a.replicate(n1)
@@ -1234,26 +1235,38 @@ for (let i = 0; i < 500; i++) {
12341235
const s1 = b.session()
12351236
const s2 = b.session()
12361237

1237-
const cancelling = waitForRequestBlock(s1).then(() => s1.close())
1238+
const cancelling = waitForRequestBlock(s1).then(() => {
1239+
console.log('calling close on s1')
1240+
return s1.close()
1241+
})
12381242

12391243
const b1 = s1.get(0)
12401244
const b2 = s2.get(0)
12411245

12421246
try {
1247+
console.log('awaiting b1')
12431248
await b1
12441249
t.fail('Should have failed')
12451250
} catch (err) {
1251+
console.log('b1 failed with', err)
12461252
t.is(err.code, 'REQUEST_CANCELLED')
12471253
}
12481254

1255+
console.log('awaiting cancelling')
12491256
await cancelling
12501257

1258+
console.log('checking a')
12511259
t.alike(await b2, b4a.from('a'))
1260+
console.log('checking b')
12521261
t.alike(await s2.get(1), b4a.from('b'))
1262+
console.log('closing s2')
12531263
await s2.close()
12541264

1265+
console.log('closing a')
12551266
await a.close()
1267+
console.log('closing b')
12561268
await b.close()
1269+
console.log('test done')
12571270
})
12581271
}
12591272

0 commit comments

Comments
 (0)