test(soak): #799 place the soak's UNS folder after #808; Windows x64 port of the lifecycle soak harness
v2-ci / unit-tests (push) Has been cancelled
v2-ci / unit-tests (push) Has been cancelled
Acceptance runs for #799 (owner scope 2026-11-12: Windows x64 + Linux) on current master. Fixture: since #808 an UNS folder the authority snapshot does not place is denied under enforcement (fail closed). The canonical soak creates its own "SoakEquipment" folder but never placed it, so on master the very first cycle's UNS monitored item came back bad (retained failed Linux launch onb61f3e05, cycle 1). The rig gains AdditionalFolderScopes (merged into FolderScopes by Enforce) and the soak places its folder there, as a deployed generation does - the same fixture gap #888 fixed for the SDK matrix. No server authorization code, cap, baseline or canonical operation changed; the soak test bodies are otherwise byte-identical tob18f9723. Windows port (test/harness only, opt-in): - DescriptorCountsAsync gains a Windows branch: total = every handle in the process handle table, PKI = disk file/directory handles whose GetFinalPathNameByHandle path lies under a canonicalised PKI root; dedicated thread under the same 5 s bound as the macOS lsof probe. - Descriptor controls enabled on Windows (symlink alias; timeout control via cmd.exe + ping). - LateSlopeRun.ValidateRequest accepts Linux ARM64 or Windows x64; duration/runtime/leak tracking unchanged. - late-slope/analyze.py: expected architecture is a module constant (Linux default Arm64 unchanged). - windows/: prepare.py (win-x64 self-contained 10.0.14 bundle + manifest), launch.ps1 (container.sh equivalent: bundle re-verification, 2/2 controls first, PID/apphost/coreclr verification, external sampler, 7440 s outer deadline), analyze.py (Linux row/window logic, X64), README with every adaptation. Claude-Session: https://claude.ai/code/session_01GT67ACmpMR7b9LGRPLijMi
This commit is contained in:
+23
-9
@@ -312,6 +312,12 @@ public sealed partial class Sdk2LifecycleSoakTests
|
||||
.Select(i => new HistoricalEvent($"soak-{i}", "source", Epoch.AddSeconds(i), Epoch, "soak", 500)).ToList());
|
||||
rig.Nm.NodeWriteGateway = new AcceptWrites();
|
||||
MaterialiseValues(rig);
|
||||
// lmxopcua#799: since #808 an unplaced UNS folder is denied under enforcement. Place the soak's own equipment
|
||||
// folder (root folder: id chain is itself; ACL path by display name, as a deployed generation does).
|
||||
rig.AdditionalFolderScopes ??= new Dictionary<string, UnsFolderScope>
|
||||
{
|
||||
["SoakEquipment"] = new(new NodeAclPath([NodeAclRealms.Uns, "Equipment"]), ["SoakEquipment"]),
|
||||
};
|
||||
rig.Enforce(true, [ServerEventRig.Key()], Grant());
|
||||
}
|
||||
|
||||
@@ -587,9 +593,9 @@ public sealed partial class Sdk2LifecycleSoakTests
|
||||
process.Threads.Count);
|
||||
}
|
||||
|
||||
public static bool DescriptorProbeSupported => OperatingSystem.IsLinux() || OperatingSystem.IsMacOS();
|
||||
public static bool DescriptorProbeSupported => OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || OperatingSystem.IsWindows();
|
||||
|
||||
[Fact(SkipUnless = nameof(DescriptorProbeSupported), Skip = "Descriptor probes require Linux procfs or macOS lsof.")]
|
||||
[Fact(SkipUnless = nameof(DescriptorProbeSupported), Skip = "Descriptor probes require Linux procfs, macOS lsof or the Windows handle table.")]
|
||||
public async Task Descriptor_probe_observes_an_open_PKI_file_through_a_symlink_alias_and_its_close()
|
||||
{
|
||||
var ct = TestContext.Current.CancellationToken;
|
||||
@@ -627,17 +633,24 @@ public sealed partial class Sdk2LifecycleSoakTests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact(SkipUnless = nameof(DescriptorProbeSupported), Skip = "The bounded probe control uses a task-owned Unix process.")]
|
||||
[Fact(SkipUnless = nameof(DescriptorProbeSupported), Skip = "The bounded probe control uses a task-owned shell process.")]
|
||||
public async Task Descriptor_probe_times_out_and_reaps_a_process_that_keeps_both_streams_open()
|
||||
{
|
||||
var ct = TestContext.Current.CancellationToken;
|
||||
using var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo("/bin/sh")
|
||||
{
|
||||
RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false,
|
||||
ArgumentList = { "-c", "printf control; printf control >&2; exec /bin/sleep 30" },
|
||||
},
|
||||
// Windows (lmxopcua#799): cmd keeps both redirected pipes open while its child ping runs for ~30 s.
|
||||
StartInfo = OperatingSystem.IsWindows()
|
||||
? new ProcessStartInfo("cmd.exe")
|
||||
{
|
||||
RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false,
|
||||
ArgumentList = { "/d", "/c", "echo control& echo control 1>&2& ping -n 31 127.0.0.1 >nul" },
|
||||
}
|
||||
: new ProcessStartInfo("/bin/sh")
|
||||
{
|
||||
RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false,
|
||||
ArgumentList = { "-c", "printf control; printf control >&2; exec /bin/sleep 30" },
|
||||
},
|
||||
};
|
||||
var elapsed = Stopwatch.StartNew();
|
||||
await Should.ThrowAsync<TimeoutException>(() => ReadDescriptorProbeAsync(process, TimeSpan.FromMilliseconds(250), ct));
|
||||
@@ -649,6 +662,7 @@ public sealed partial class Sdk2LifecycleSoakTests
|
||||
private static async Task<(int Total, int Pki)> DescriptorCountsAsync(CancellationToken ct, params string[] roots)
|
||||
{
|
||||
ct.ThrowIfCancellationRequested();
|
||||
if (OperatingSystem.IsWindows()) return await WindowsDescriptorCountsAsync(ct, roots);
|
||||
var canonicalRoots = roots.Select(root => CanonicalPath(root)).Distinct(StringComparer.Ordinal).ToArray();
|
||||
if (OperatingSystem.IsLinux())
|
||||
{
|
||||
@@ -678,7 +692,7 @@ public sealed partial class Sdk2LifecycleSoakTests
|
||||
}
|
||||
return (total, pki);
|
||||
}
|
||||
throw new PlatformNotSupportedException("This soak requires Linux procfs or macOS lsof for actual descriptor evidence.");
|
||||
throw new PlatformNotSupportedException("This soak requires Linux procfs, macOS lsof or the Windows handle table for actual descriptor evidence.");
|
||||
}
|
||||
|
||||
private static async Task<string> ReadDescriptorProbeAsync(Process process, TimeSpan timeout, CancellationToken ct)
|
||||
|
||||
Reference in New Issue
Block a user