From e0cd8011167557f2ddb1b976e604cfd94d8b393d Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Sat, 24 Jun 2023 16:11:39 +0300 Subject: [PATCH] server_test: wait for OnClose in TestClientEOF. In the test for client Call failing with ErrClosed on a closed server, wait for the client's OnClose handler to get triggered to make sure closing the socket had properly been administered on the client's side. Otherwise trying a new Call() might fail with some other error than ErrClosed, for instance ENOTCONN. Signed-off-by: Krisztian Litkey --- server_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server_test.go b/server_test.go index 4c5430a..595213e 100644 --- a/server_test.go +++ b/server_test.go @@ -363,6 +363,8 @@ func TestClientEOF(t *testing.T) { t.Fatal(err) } + client.UserOnCloseWait(ctx) + // server shutdown, but we still make a call. if err := client.Call(ctx, serviceName, "Test", tp, tp); err == nil { t.Fatalf("expected error when calling against shutdown server")