(t *testing.T)
| 80 | } |
| 81 | |
| 82 | func TestTee_DropOnMemoryPressure(t *testing.T) { |
| 83 | t.Parallel() |
| 84 | var paused atomic.Bool |
| 85 | paused.Store(true) |
| 86 | tt, _, rec := newTestTee(t, 1<<20, 4, paused.Load) |
| 87 | |
| 88 | if tt.push(mkChunk("x")) { |
| 89 | t.Fatalf("push should have dropped under memory pressure") |
| 90 | } |
| 91 | if rec.count(DropMemoryPressure) != 1 { |
| 92 | t.Fatalf("want 1 memory_pressure drop, got reasons %v", rec.snapshot()) |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | func TestTee_DropOnPerConnCap(t *testing.T) { |
| 97 | t.Parallel() |