MCPcopy Index your code
hub / github.com/coder/coder / IgnoreLoggedError

Function IgnoreLoggedError

testutil/logger.go:25–40  ·  view source on GitHub ↗
(entry slog.SinkEntry)

Source from the content-addressed store, hash-verified

23}
24
25func IgnoreLoggedError(entry slog.SinkEntry) bool {
26 err, ok := slogtest.FindFirstError(entry)
27 if !ok {
28 return false
29 }
30 // Yamux sessions get shut down when we are shutting down tests, so ignoring
31 // them should reduce flakiness.
32 if xerrors.Is(err, yamux.ErrSessionShutdown) {
33 return true
34 }
35 // Canceled queries usually happen when we're shutting down tests, and so
36 // ignoring them should reduce flakiness. This also includes
37 // context.Canceled and context.DeadlineExceeded errors, even if they are
38 // not part of a query.
39 return isQueryCanceledError(err)
40}
41
42// isQueryCanceledError checks if the error is due to a query being canceled. This reproduces
43// database.IsQueryCanceledError, but is reimplemented here to avoid importing the database package,

Callers

nothing calls this directly

Calls 2

isQueryCanceledErrorFunction · 0.85
IsMethod · 0.45

Tested by

no test coverage detected