Skip to content

Commit f214940

Browse files
author
brett-bonner_infodesk
committed
fix(test): opt the out-of-order fixture test into request pipelining
The out_of_order_bridge fixture only responds once two requests are in flight, but the pool now defaults to one in-flight request per worker (#284) — the second call was never sent and the first deadlocked into its 2s timeout. Pass maxConcurrentPerProcess: 2 so the reordering path is actually exercised.
1 parent 17274c4 commit f214940

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

test/adversarial_playground.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ const createBridge = async (
8585

8686
const createFixtureBridge = async (
8787
scriptName: string,
88-
options: { timeoutMs?: number; env?: Record<string, string | undefined> } = {}
88+
options: {
89+
timeoutMs?: number;
90+
maxConcurrentPerProcess?: number;
91+
env?: Record<string, string | undefined>;
92+
} = {}
8993
): Promise<NodeBridge | null> => {
9094
const fixtureScript = join(fixturesDir, scriptName);
9195
if (!existsSync(fixtureScript)) {
@@ -98,6 +102,7 @@ const createFixtureBridge = async (
98102
return new NodeBridge({
99103
scriptPath: fixtureScript,
100104
pythonPath,
105+
maxConcurrentPerProcess: options.maxConcurrentPerProcess,
101106
// Default to the suite budget: error-surfacing tests assert LOUDNESS, not
102107
// latency, and must absorb worker cold-start/import costs under full-suite
103108
// load (#285). Timeout-behavior tests pass explicit small values.
@@ -683,7 +688,14 @@ describeAdversarial('Adversarial playground', () => {
683688
it(
684689
'handles out-of-order responses',
685690
async () => {
686-
const bridge = await createFixtureBridge('out_of_order_bridge.py', { timeoutMs: 2000 });
691+
// The fixture only responds once it has TWO requests in flight, so
692+
// pipelining must be opted into: the pool default is one in-flight
693+
// request per worker (#284), under which the second call would never
694+
// be sent and the first would deadlock into its timeout.
695+
const bridge = await createFixtureBridge('out_of_order_bridge.py', {
696+
timeoutMs: 2000,
697+
maxConcurrentPerProcess: 2,
698+
});
687699
if (!bridge) return;
688700

689701
try {

0 commit comments

Comments
 (0)