| 1 | package agent |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "testing" |
| 6 | "time" |
| 7 | |
| 8 | "go.uber.org/goleak" |
| 9 | ) |
| 10 | |
| 11 | func TestMain(m *testing.M) { |
| 12 | // Stream body retries use multi-second backoff in production; collapse it |
| 13 | // in package tests so recovery suites stay deterministic and fast. |
| 14 | streamRetrySleep = func(ctx context.Context, _ int) bool { |
| 15 | return ctx.Err() == nil |
| 16 | } |
| 17 | recoverySleep = func(ctx context.Context, _ time.Duration) bool { return ctx.Err() == nil } |
| 18 | goleak.VerifyTestMain(m) |
| 19 | } |
| 20 |