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 <krisztian.litkey@intel.com>
This commit is contained in:
Krisztian Litkey 2023-06-24 16:11:39 +03:00
parent 712429a9f0
commit e0cd801116

View File

@ -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")