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 60d8a93
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 @@ -370,6 +371,13 @@ func TestClientEOF(t *testing.T) {
t.Fatalf("expected error when calling against shutdown server")
} else if !errors.Is(err, ErrClosed) {
t.Fatalf("expected to have a cause of ErrClosed, got %v", err)

errno, ok := err.(syscall.Errno)
if ok {
t.Logf("errno=%d", errno)
} else {
t.Logf("error %q doesn't match syscall.Errno", err)
}
}
}

Expand Down

0 comments on commit 60d8a93

Please sign in to comment.