docs(worker): record the SemaphoreSlim/STA dispatch invariant + single-waiter contract; harden fake
This commit is contained in:
@@ -303,6 +303,17 @@ internal sealed class FakeRuntimeSession : IWorkerRuntimeSession
|
||||
|
||||
if (BackingQueue is not null)
|
||||
{
|
||||
if (WaitForEventsOnSignalOnly)
|
||||
{
|
||||
// The two are mutually exclusive: a real backing queue owns its own signal and
|
||||
// always honours the timeout, so silently letting it win would leave a
|
||||
// signal-only test passing on a fallback tick — exactly the false green the
|
||||
// option exists to rule out.
|
||||
throw new InvalidOperationException(
|
||||
"FakeRuntimeSession cannot combine BackingQueue with WaitForEventsOnSignalOnly: "
|
||||
+ "the backing queue honours the fallback timeout, which defeats the signal-only wait.");
|
||||
}
|
||||
|
||||
// Tests that drive a real queue enqueue into it directly, so the real queue owns the
|
||||
// wake signal too.
|
||||
return BackingQueue.WaitForEventsAsync(timeout, cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user