Skip to content

Commit

Permalink
Log the error's underyling errno if there is
Browse files Browse the repository at this point in the history
This test occasionally fails on Windows. This commit logs extra
information about the error to understand the situation better.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
  • Loading branch information
kzys committed Feb 21, 2022
1 parent 332f4c9 commit 44dfd7f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"runtime"
"strings"
"sync"
"syscall"
"testing"
"time"

Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 44dfd7f

Please sign in to comment.