From b0af7fc0651e617334938693eef5e545592ac818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20=C4=B0rgin?= Date: Tue, 3 Nov 2026 23:28:36 +0300 Subject: [PATCH] test: the event reader rows bound their waits for late failures Under a fault that loses a late failure, the row waited forever and the test host never ended. Refs #758. --- .../Support/OwnedEventReaderTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/OpenCode.Sdk.Tests/Support/OwnedEventReaderTests.cs b/tests/OpenCode.Sdk.Tests/Support/OwnedEventReaderTests.cs index 2f72abecd..0611ff381 100644 --- a/tests/OpenCode.Sdk.Tests/Support/OwnedEventReaderTests.cs +++ b/tests/OpenCode.Sdk.Tests/Support/OwnedEventReaderTests.cs @@ -91,10 +91,10 @@ public async Task CompleteAsync_Should_Bound_Stalls_Reach_Removal_And_Attach_Lat pending.SetException(readerFailure); var report = owner.LateFailures; await Assert.That(report).IsNotNull(); - var observed = await report.WaitForFailureAsync(CancellationToken.None); + var observed = await report.WaitForFailureAsync(CancellationToken.None).WaitAsync(HangGuard.Bound); await Assert.That(observed.Value).IsSameReferenceAs(readerFailure); release.Set(); - await report.WaitForAllAsync(CancellationToken.None); + await report.WaitForAllAsync(CancellationToken.None).WaitAsync(HangGuard.Bound); // Late failure completion order is not part of this assertion's contract. await Assert.That(attached.Select(entry => entry.Value)).IsEquivalentTo(new Exception[] { readerFailure, callbackFailure }, CollectionOrdering.Any); // Late failure completion order is not part of this assertion's contract. @@ -107,7 +107,7 @@ public async Task CompleteAsync_Should_Bound_Stalls_Reach_Removal_And_Attach_Lat await scenario.DrainAsync(completing); if (owner.LateFailures is { } report) { - await report.WaitForAllAsync(CancellationToken.None); + await report.WaitForAllAsync(CancellationToken.None).WaitAsync(HangGuard.Bound); } } } @@ -193,7 +193,7 @@ public async Task CompleteAsync_Should_Observe_Late_Cooperative_Cancellation_Aft await Assert.That(report).IsNotNull(); pending.SetCanceled(token); - await report.WaitForAllAsync(CancellationToken.None); + await report.WaitForAllAsync(CancellationToken.None).WaitAsync(HangGuard.Bound); await Assert.That(report.Failures).IsEmpty(); } @@ -203,7 +203,7 @@ public async Task CompleteAsync_Should_Observe_Late_Cooperative_Cancellation_Aft await scenario.DrainAsync(completing); if (owner.LateFailures is { } report) { - await report.WaitForAllAsync(CancellationToken.None); + await report.WaitForAllAsync(CancellationToken.None).WaitAsync(HangGuard.Bound); } } }