MCPcopy
hub / github.com/keploy/keploy / TestTee_DropOnMemoryPressure

Function TestTee_DropOnMemoryPressure

pkg/agent/proxy/relay/tee_test.go:82–94  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

80}
81
82func 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
96func TestTee_DropOnPerConnCap(t *testing.T) {
97 t.Parallel()

Callers

nothing calls this directly

Calls 6

newTestTeeFunction · 0.85
mkChunkFunction · 0.85
StoreMethod · 0.45
pushMethod · 0.45
countMethod · 0.45
snapshotMethod · 0.45

Tested by

no test coverage detected