@@ -1226,6 +1226,7 @@ for (let i = 0; i < 500; i++) {
1226
1226
const b = await create ( a . key )
1227
1227
1228
1228
await a . append ( [ 'a' , 'b' , 'c' ] )
1229
+ console . log ( 'appended blocks' )
1229
1230
1230
1231
const [ n1 , n2 ] = makeStreamPair ( t , { latency : [ 50 , 50 ] } )
1231
1232
a . replicate ( n1 )
@@ -1234,26 +1235,38 @@ for (let i = 0; i < 500; i++) {
1234
1235
const s1 = b . session ( )
1235
1236
const s2 = b . session ( )
1236
1237
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
+ } )
1238
1242
1239
1243
const b1 = s1 . get ( 0 )
1240
1244
const b2 = s2 . get ( 0 )
1241
1245
1242
1246
try {
1247
+ console . log ( 'awaiting b1' )
1243
1248
await b1
1244
1249
t . fail ( 'Should have failed' )
1245
1250
} catch ( err ) {
1251
+ console . log ( 'b1 failed with' , err )
1246
1252
t . is ( err . code , 'REQUEST_CANCELLED' )
1247
1253
}
1248
1254
1255
+ console . log ( 'awaiting cancelling' )
1249
1256
await cancelling
1250
1257
1258
+ console . log ( 'checking a' )
1251
1259
t . alike ( await b2 , b4a . from ( 'a' ) )
1260
+ console . log ( 'checking b' )
1252
1261
t . alike ( await s2 . get ( 1 ) , b4a . from ( 'b' ) )
1262
+ console . log ( 'closing s2' )
1253
1263
await s2 . close ( )
1254
1264
1265
+ console . log ( 'closing a' )
1255
1266
await a . close ( )
1267
+ console . log ( 'closing b' )
1256
1268
await b . close ( )
1269
+ console . log ( 'test done' )
1257
1270
} )
1258
1271
}
1259
1272
0 commit comments