Skip to content

Commit 818d4d0

Browse files
authored
chore: ignore 'session shutdown' yamux error in tests (#17964)
Fixes flake seen here: https://github.com/coder/coder/actions/runs/15154327939/job/42606133069?pr=17960 Error log dropped when the dRPC server is being shut down right as we are (re)dialing.
1 parent 3654a49 commit 818d4d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

testutil/logger.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"strings"
66
"testing"
77

8+
"github.com/hashicorp/yamux"
89
"golang.org/x/xerrors"
910

1011
"cdr.dev/slog"
@@ -24,6 +25,11 @@ func IgnoreLoggedError(entry slog.SinkEntry) bool {
2425
if !ok {
2526
return false
2627
}
28+
// Yamux sessions get shut down when we are shutting down tests, so ignoring
29+
// them should reduce flakiness.
30+
if xerrors.Is(err, yamux.ErrSessionShutdown) {
31+
return true
32+
}
2733
// Canceled queries usually happen when we're shutting down tests, and so
2834
// ignoring them should reduce flakiness. This also includes
2935
// context.Canceled and context.DeadlineExceeded errors, even if they are

0 commit comments

Comments
 (0)