Skip to content

Commit a92b596

Browse files
dwcullopCopilot
andcommitted
Fix MergeMany stress test timing for queue-based delivery
The MultiThreadedStressTest asserts immediately after stress observables complete, but with drain-outside-lock delivery, Edit() returns after enqueueing while delivery may still be in-flight on another thread. Add a short delay before checking results to allow in-flight deliveries to complete. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5e4ad0e commit a92b596

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/DynamicData.Tests/Cache/MergeManyChangeSetsCacheSourceCompareFixture.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ IObservable<MarketPrice> AddRemovePrices(Market market, int priceCount, int para
118118
}
119119
while (adding);
120120

121+
// Allow any in-flight notification deliveries to complete before checking results.
122+
// With the queue-based drain pattern, Edit() returns after enqueueing but delivery
123+
// may still be in progress on another thread. Give the drain a moment to finish.
124+
await Task.Delay(250).ConfigureAwait(false);
125+
121126
// Verify the results
122127
CheckResultContents(_marketCacheResults, priceResults, Market.RatingCompare);
123128
}

0 commit comments

Comments
 (0)