func TestIdleTimeout(t *testing.T) { … } type msg … type fakeHandler … func (fakeHandler) Handle(ctx context.Context, req *jsonrpc2.Request) (interface{ … } func TestServe(t *testing.T) { … } func newFake(t *testing.T, ctx context.Context, l jsonrpc2.Listener) (*jsonrpc2.Connection, func(), error) { … } // TestIdleListenerAcceptCloseRace checks for the Accept/Close race fixed in CL 388597. // // (A bug in the idleListener implementation caused a successful Accept to block // on sending to a background goroutine that could have already exited.) func TestIdleListenerAcceptCloseRace(t *testing.T) { … } // TestCloseCallRace checks for a race resulting in a deadlock when a Call on // one side of the connection races with a Close (or otherwise broken // connection) initiated from the other side. // // (The Call method was waiting for a result from the Read goroutine to // determine which error value to return, but the Read goroutine was waiting for // in-flight calls to complete before reporting that result.) func TestCloseCallRace(t *testing.T) { … }