MCPcopy Create free account
hub / github.com/AGenUI/AGenUI / TEST_F

Function TEST_F

tests/cpp/concurrency/queue_pressure_test.cpp:40–54  ·  view source on GitHub ↗

QP001: Burst 10K small tasks via receiveTextChunk, then drain. Memory (queue depth) is observable indirectly via worker-idle latency.

Source from the content-addressed store, hash-verified

38// QP001: Burst 10K small tasks via receiveTextChunk, then drain. Memory
39// (queue depth) is observable indirectly via worker-idle latency.
40TEST_F(QueuePressureTest, QP001_BurstReceive10K_DrainsCleanly) {
41 ::agenui::testing::ScopedSurfaceManager sm;
42 constexpr int N = 10000;
43 auto begin = std::chrono::steady_clock::now();
44 sm->beginTextStream();
45 for (int i = 0; i < N; ++i) {
46 sm->receiveTextChunk("x");
47 }
48 sm->endTextStream();
49 ASSERT_TRUE(::agenui::testing::WaitForWorkerIdle(30000));
50 auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(
51 std::chrono::steady_clock::now() - begin).count();
52 // No hard latency contract; just sanity bound to catch infinite loops.
53 EXPECT_LT(elapsed, 30000) << "elapsed ms=" << elapsed;
54}
55
56// QP002: Burst then immediately destroy. All queued tasks hold a shared_ptr
57// to the SM via lambda capture. Destroy enqueues uninit; queue must drain

Callers

nothing calls this directly

Calls 13

WaitForWorkerIdleFunction · 0.85
LoadFixtureOrEmptyFunction · 0.85
emptyMethod · 0.80
waitForMethod · 0.80
submitUIActionMethod · 0.65
getMethod · 0.65
beginTextStreamMethod · 0.45
receiveTextChunkMethod · 0.45
endTextStreamMethod · 0.45
createSurfaceManagerMethod · 0.45

Tested by

no test coverage detected