diff --git a/src/ZB.MOM.WW.MxGateway.Worker.Tests/Ipc/WorkerPipeSessionTests.cs b/src/ZB.MOM.WW.MxGateway.Worker.Tests/Ipc/WorkerPipeSessionTests.cs
index 65e8468..56fe252 100644
--- a/src/ZB.MOM.WW.MxGateway.Worker.Tests/Ipc/WorkerPipeSessionTests.cs
+++ b/src/ZB.MOM.WW.MxGateway.Worker.Tests/Ipc/WorkerPipeSessionTests.cs
@@ -20,12 +20,17 @@ public sealed class WorkerPipeSessionTests
private const string Nonce = "nonce-secret";
// Byte-heavy drain fixture (WRK-21). 10,000 events at ~1.7 KiB each is ~17 MB of queue — far
- // more than one frame — so DrainEvents must split across replies. The negotiated frame maximum
- // is deliberately smaller than the compile-time default so the split happens in a handful of
- // multi-MB frames instead of moving 17 MB through the test pipe.
+ // more than one frame — so DrainEvents must split across replies.
+ //
+ // The negotiated frame maximum is deliberately small. What is under test is the byte cap, and
+ // it behaves identically at any frame size, but this harness is not the production gateway:
+ // PipePair has no continuous read pump, so the test thread only drains the pipe while it sits
+ // in ReadUntilAsync. Multi-megabyte frames interleaved with the heartbeat loop can therefore
+ // wedge both ends inside FlushFileBuffers, each waiting for the other to read. A frame maximum
+ // well under the pipe buffer keeps the harness honest without weakening a single assertion.
private const int ByteHeavyEventCount = 10_000;
private const int ByteHeavyEventPayloadBytes = 1_800;
- private const uint NegotiatedMaxFrameBytes = 2 * 1024 * 1024;
+ private const uint NegotiatedMaxFrameBytes = 128 * 1024;
/// Verifies that valid gateway hello triggers worker hello and ready responses.
/// A task that represents the asynchronous operation.
@@ -611,7 +616,7 @@ public sealed class WorkerPipeSessionTests
recovered.Add(drained.WorkerSequence);
}
- Assert.True(replyCount < 100, "DrainEvents made no progress across 100 replies.");
+ Assert.True(replyCount < 1_000, "DrainEvents made no progress across 1,000 replies.");
}
// More than one reply proves the drain really split; every event came back exactly once, in