dont use pull.drain without done cb in test code

and change timeouts slightly
This commit is contained in:
Henry 2021-04-26 12:21:00 +02:00
parent 97dc3c2df5
commit 9b9db80406
3 changed files with 8 additions and 4 deletions

View File

@ -25,6 +25,8 @@ module.exports = (t, client, roomrpc, exit) => {
roomrpc.tunnel.endpoints(), roomrpc.tunnel.endpoints(),
pull.drain(el => { pull.drain(el => {
comment(`from roomsrv: ${JSON.stringify(el)}`) comment(`from roomsrv: ${JSON.stringify(el)}`)
}, (err) => {
t.comment('endpoints closed', err)
}) })
) )

View File

@ -19,10 +19,10 @@ module.exports = (t, sbot, rpc, exit) => {
t.error(err, 'tunnel.leave') t.error(err, 'tunnel.leave')
comment(`tunnel error: ${err}`) comment(`tunnel error: ${err}`)
comment(`leave value: ${ret}`) comment(`leave value: ${ret}`)
comment('left, exiting in 1s') comment('left, exiting in 3s')
setTimeout(exit, 1000) setTimeout(exit, 3000)
}) })
}, 3000) }, 1000)
}) })
// announce ourselves to the room/tunnel // announce ourselves to the room/tunnel
@ -38,6 +38,8 @@ module.exports = (t, sbot, rpc, exit) => {
rpc.tunnel.endpoints(), rpc.tunnel.endpoints(),
pull.drain(el => { pull.drain(el => {
comment(`from roomsrv: ${el}`) comment(`from roomsrv: ${el}`)
}, (err) => {
t.comment('endpoints closed', err)
}) })
) )
} }

View File

@ -159,7 +159,7 @@ func TestClientSurvivesShutdown(t *testing.T) {
) )
// give them time to connect (which would make them pass the test) // give them time to connect (which would make them pass the test)
time.Sleep(6 * time.Second) time.Sleep(8 * time.Second)
// shut down server (which closes all the muxrpc streams) // shut down server (which closes all the muxrpc streams)
srv.Close() srv.Close()