From fc400d693e1336020493bcaeaf9026823e9f5585 Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Wed, 21 May 2025 11:14:45 +0400 Subject: [PATCH 1/2] chore: ignore 'session shutdown' yamux error in tests --- testutil/logger.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testutil/logger.go b/testutil/logger.go index 47cb835aa16aa..018ebde02e15c 100644 --- a/testutil/logger.go +++ b/testutil/logger.go @@ -2,6 +2,7 @@ package testutil import ( "context" + "github.com/hashicorp/yamux" "strings" "testing" @@ -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 From 4005734046c12ec7894a4fe868984175d5e3c997 Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Wed, 21 May 2025 11:20:22 +0400 Subject: [PATCH 2/2] fix imports --- testutil/logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testutil/logger.go b/testutil/logger.go index 018ebde02e15c..88b6e20bada51 100644 --- a/testutil/logger.go +++ b/testutil/logger.go @@ -2,10 +2,10 @@ package testutil import ( "context" - "github.com/hashicorp/yamux" "strings" "testing" + "github.com/hashicorp/yamux" "golang.org/x/xerrors" "cdr.dev/slog"