test(virtual-tags): unbreak script-timeout test after sandbox deny-list change

The Timeout_maps_to_BadInternalError_without_killing_the_engine test's
"Hang" script busy-looped on Environment.TickCount64. Commit cfb9ff1
(Core.Scripting-001) added System.Environment to the script-sandbox
deny-list, so the script now fails sandbox validation instead of
reaching the timeout path. Switch the busy-loop to DateTime.UtcNow
(an allowed type) to preserve the test's intent — a self-terminating
~5s hang that overruns the 30ms script timeout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-05-22 07:06:27 -04:00
parent 371fe2127c
commit 40f06314fb

View File

@@ -140,8 +140,8 @@ public sealed class VirtualTagEngineTests
engine.Load([ engine.Load([
new VirtualTagDefinition("Hang", DriverDataType.Int32, """ new VirtualTagDefinition("Hang", DriverDataType.Int32, """
var end = Environment.TickCount64 + 5000; var end = DateTime.UtcNow.AddSeconds(5);
while (Environment.TickCount64 < end) { } while (DateTime.UtcNow < end) { }
return 1; return 1;
"""), """),
new VirtualTagDefinition("Ok", DriverDataType.Int32, """return 42;"""), new VirtualTagDefinition("Ok", DriverDataType.Int32, """return 42;"""),