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.
This commit is contained in:
Spike Curtis
2025-05-21 11:29:25 +04:00
committed by GitHub
parent 3654a49fb5
commit 818d4d03f4
+6
View File
@@ -5,6 +5,7 @@ import (
"strings"
"testing"
"github.com/hashicorp/yamux"
"golang.org/x/xerrors"
"cdr.dev/slog"
@@ -24,6 +25,11 @@ func IgnoreLoggedError(entry slog.SinkEntry) bool {
if !ok {
return false
}
// Yamux sessions get shut down when we are shutting down tests, so ignoring
// them should reduce flakiness.
if xerrors.Is(err, yamux.ErrSessionShutdown) {
return true
}
// Canceled queries usually happen when we're shutting down tests, and so
// ignoring them should reduce flakiness. This also includes
// context.Canceled and context.DeadlineExceeded errors, even if they are