From 44dfd7fdbd0fd19528c1ffc9f2ce11a165fbafb7 Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Mon, 21 Feb 2022 21:28:26 +0000 Subject: [PATCH] Log the error's underyling errno if there is This test occasionally fails on Windows. This commit logs extra information about the error to understand the situation better. Signed-off-by: Kazuyoshi Kato --- server_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server_test.go b/server_test.go index ef8092c..5644c14 100644 --- a/server_test.go +++ b/server_test.go @@ -25,6 +25,7 @@ import ( "runtime" "strings" "sync" + "syscall" "testing" "time" @@ -369,6 +370,13 @@ func TestClientEOF(t *testing.T) { if err := client.Call(ctx, serviceName, "Test", tp, tp); err == nil { t.Fatalf("expected error when calling against shutdown server") } else if !errors.Is(err, ErrClosed) { + errno, ok := err.(syscall.Errno) + if ok { + t.Logf("errno=%d", errno) + } else { + t.Logf("error %q doesn't match syscall.Errno", err) + } + t.Fatalf("expected to have a cause of ErrClosed, got %v", err) } }