diff --git a/tests/DodoSSH.Client.App.Tests/ShellFlowTests.Forwards.cs b/tests/DodoSSH.Client.App.Tests/ShellFlowTests.Forwards.cs index 2caa3ef..af580a6 100644 --- a/tests/DodoSSH.Client.App.Tests/ShellFlowTests.Forwards.cs +++ b/tests/DodoSSH.Client.App.Tests/ShellFlowTests.Forwards.cs @@ -114,6 +114,13 @@ public sealed partial class ShellFlowTests await EventuallyAsync(() => !tab.IsLive, "the dropped shell should have ended the session"); + // Waited for in its own right rather than taken as read from IsLive. Ended clears IsLive and then + // ends the forwards in the same dispatcher turn, which the app's UI thread never splits — but this + // harness's post runs the ending on the fake shell's thread, so a poll from here can land between. + await EventuallyAsync( + () => tab.Forwards.All(row => row.Detail == "Stopped with the session."), + "the session's end should have reached its forwards"); + tab.Forwards.ShouldAllBe(row => row.State == PortForwardState.Stopped); tab.Forwards.ShouldAllBe(row => row.Detail == "Stopped with the session."); tab.Forwards.ShouldAllBe(row => !row.CanToggle);