This commit is contained in:
Alan Donovan 2021-08-31 17:30:40 -04:00
parent 273782bcbc
commit 55fa17d8bc
5 changed files with 19 additions and 18 deletions

View file

@ -15,7 +15,8 @@ func TestRPCHandlerEvents(t *testing.T) {
time.Sleep(1 * time.Second)
rpcHandler.Handle(context.Background(), nil, &jsonrpc2.Request{Method: "somethingHappened"})
}()
ctx, _ := context.WithDeadline(context.Background(), time.Now().Add(5*time.Second))
ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(5*time.Second))
defer cancel()
select {
case event := <-eventCh:
if event.Method != "somethingHappened" {