Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PUBLIC-EXPORT-MANIFEST.json
Original file line number Diff line number Diff line change
Expand Up @@ -3589,7 +3589,7 @@
{
"mode": "644",
"path": "tests/Vyral.Tests.Conformance/PortableNativeExecutionLifecycleFixtureTests.cs",
"sha256": "7a215e545856a7d989f48bb74fe5aee557d596ed315d38d8e39d64ab96b091ac"
"sha256": "4954dce087f8c13ee709195b505e3456b8f288460993505039b1defb8ce7d4e9"
},
{
"mode": "644",
Expand Down Expand Up @@ -4089,5 +4089,5 @@
],
"schemaVersion": 1,
"sourceDirty": false,
"treeSha256": "ab0c8cce92a13d4aad77ce0b80d86ac70d6e2c5ac7b341c50b36a7b4e39d93c7"
"treeSha256": "16d953977567cbb53f57e1d59b047e8da3631cce744876a6753477016ba353a1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,10 @@ private async Task<JsonObject> WaitRestartAsync(
_runtime,
run.Id,
ExecutionRunStatuses.Waiting);
await WaitForHistoryEventAsync(
_runtime,
run.Id,
ExecutionEventTypes.WaitRegistered);

_runtime = CreateRuntime();
var rawEvent = arguments.GetProperty("event");
Expand Down Expand Up @@ -614,6 +618,24 @@ run is not null
throw new TimeoutException(
$"Run {runId} did not become {status}.");
}

private static async Task WaitForHistoryEventAsync(
IExecutionRuntime runtime,
string runId,
string eventType)
{
for (var attempt = 0; attempt < 400; attempt++)
{
var history = await runtime.GetHistoryAsync(runId);
if (history.Any(item => item.Type == eventType))
{
return;
}
await Task.Delay(10);
}
throw new TimeoutException(
$"Run {runId} did not record {eventType}.");
}
}

private static T Deserialize<T>(JsonElement value)
Expand Down
Loading