1
0
Fork 0
mirror of https://github.com/sourcegraph/jsonrpc2.git synced 2026-06-16 04:04:56 +02:00
This commit is contained in:
sourcegraph-bot 2021-11-20 07:06:28 +00:00 committed by GitHub
commit e58a7f5b4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,7 +121,7 @@ func TestClientServer(t *testing.T) {
if err != nil {
t.Fatal("Listen:", err)
}
defer func() {
t.Cleanup(func() {
if lis == nil {
return // already closed
}
@ -130,7 +130,7 @@ func TestClientServer(t *testing.T) {
t.Fatal(err)
}
}
}()
})
ha := testHandlerA{t: t}
go func() {
@ -184,11 +184,11 @@ func TestClientServer(t *testing.T) {
func testClientServer(ctx context.Context, t *testing.T, stream jsonrpc2.ObjectStream) {
hb := testHandlerB{t: t}
cc := jsonrpc2.NewConn(ctx, stream, &hb)
defer func() {
t.Cleanup(func() {
if err := cc.Close(); err != nil {
t.Fatal(err)
}
}()
})
// Simple
const n = 100