From 44967620272aeba13e4752885fac252db1a23309 Mon Sep 17 00:00:00 2001 From: jeremydixon22 Date: Mon, 17 Aug 2026 22:33:48 -0400 Subject: [PATCH] Stabilize restart conformance test --- .../PortableNativeExecutionLifecycleFixtureTests.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/Vyral.Tests.Conformance/PortableNativeExecutionLifecycleFixtureTests.cs b/tests/Vyral.Tests.Conformance/PortableNativeExecutionLifecycleFixtureTests.cs index e328538..11f2d71 100644 --- a/tests/Vyral.Tests.Conformance/PortableNativeExecutionLifecycleFixtureTests.cs +++ b/tests/Vyral.Tests.Conformance/PortableNativeExecutionLifecycleFixtureTests.cs @@ -440,6 +440,10 @@ await WaitForHistoryEventAsync( ExecutionEventTypes.WaitRegistered); _runtime = CreateRuntime(); + // Recover persisted state before delivering the event. Recovering after the + // event can mistake the newly resumed worker for interrupted work. + await _runtime.DispatchReadyRunsAsync( + recoverInterruptedRuns: true); var rawEvent = arguments.GetProperty("event"); await _runtime.RaiseEventAsync( new ExecutionExternalEventRequest @@ -449,8 +453,7 @@ await _runtime.RaiseEventAsync( Payload = JsonNode.Parse( rawEvent.GetProperty("payload").GetRawText()) }); - await _runtime.DispatchReadyRunsAsync( - recoverInterruptedRuns: true); + await _runtime.DispatchReadyRunsAsync(); var final = await WaitForStatusAsync( _runtime, run.Id,