(entry slog.SinkEntry)
| 23 | } |
| 24 | |
| 25 | func 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, |
nothing calls this directly
no test coverage detected