diff --git a/src/ReactiveUI.Tests/Commands/ReactiveCommandTest.cs b/src/ReactiveUI.Tests/Commands/ReactiveCommandTest.cs index 34776ceda1..082cc0a01a 100644 --- a/src/ReactiveUI.Tests/Commands/ReactiveCommandTest.cs +++ b/src/ReactiveUI.Tests/Commands/ReactiveCommandTest.cs @@ -1811,14 +1811,27 @@ await Task.Delay( fixture.ThrownExceptions.Subscribe(_ => { }); var latestIsExecutingValue = false; + var subscriptionReady = new TaskCompletionSource(); + var isFirstValue = true; + fixture.IsExecuting.Subscribe(isExec => { statusTrail.Add((position++, $"command executing = {isExec}")); Volatile.Write( ref latestIsExecutingValue, isExec); + + // Signal that we've received the first value (should be false initially) + if (isFirstValue) + { + isFirstValue = false; + subscriptionReady.TrySetResult(true); + } }); + // Wait for the subscription to receive the initial value + await subscriptionReady.Task; + var disposable = fixture.Execute().Subscribe(); // Phase 1