fix(runtime): review findings — recursion-safe run cap, atomic detach counter, summary edge cases, per-row event-log fallback

This commit is contained in:
Joseph Doherty
2026-08-14 23:42:29 -04:00
parent b1de9dfdd4
commit 950c54c5fc
10 changed files with 626 additions and 42 deletions
@@ -85,7 +85,12 @@ public class ScriptDeadlineAtEnqueueTests : TestKit, IDisposable
var lateOptions = new SiteRuntimeOptions
{
ScriptExecutionTimeoutSeconds = 1,
StuckScriptGraceMs = 1000
StuckScriptGraceMs = 1000,
// WP3.2 defaults per-run Started/Completed events OFF, which would make the
// "no started event" assertion below vacuously true whether the body ran or not.
// Opt back in so that assertion actually discriminates: a body that reached the
// run loop WOULD emit "started" here, and its absence is therefore evidence.
PerRunScriptEvents = true
};
var late = BuildScriptActor(
"Late",
@@ -112,6 +117,8 @@ public class ScriptDeadlineAtEnqueueTests : TestKit, IDisposable
{
var rows = siteLog.OfType("script");
// Timeout path only — no "started" Info event, because the body was skipped.
// Per-run events are ON for this script (see lateOptions), so this absence is a
// real signal rather than the global default.
Assert.Contains(rows, r => r.Severity == "Error" && r.Message.Contains("timed out"));
Assert.DoesNotContain(rows, r => r.Message.Contains("started", StringComparison.OrdinalIgnoreCase));
}, TimeSpan.FromSeconds(5));