Describe the bug
There is no existing test coverage for _classify_worker_death() in src/nooa/runtime/sandbox/executor.py or for the platform-guard behaviour of probe_capabilities() / apply_rlimits() in src/nooa/runtime/sandbox/guards.py.
Both functions were patched in #92 to guard against missing POSIX-only constants (signal.SIGXCPU, signal.SIGKILL) and the missing resource module on Windows. Without regression tests, any future refactor could silently revert those guards and the bugs would return undetected — CI would not catch it because the suite runs only on Linux today (see #95).
What's missing
- No test calls
_classify_worker_death() with a simulated Windows environment (i.e. signal.SIGXCPU / signal.SIGKILL absent).
- No test calls
probe_capabilities() with resource absent and asserts rlimit=False is returned instead of a crash.
- No test calls
apply_rlimits() with resource absent and asserts it returns early rather than raising ModuleNotFoundError.
Confirmed by searching tests/ — zero hits for _classify_worker_death, SIGXCPU, SIGKILL, or WorkerDiedError in a death-classification context.
Expected behavior
Regression tests that:
- Use
monkeypatch.delattr to simulate a Windows signal module (remove SIGXCPU and SIGKILL) and assert _classify_worker_death() falls through cleanly without raising AttributeError.
- Use
monkeypatch to make import resource raise ImportError and assert probe_capabilities() returns Capabilities(..., rlimit=False) without crashing.
- Same for
apply_rlimits() — assert it returns early when resource is unavailable.
Environment
- Not platform-specific — these tests should run on Linux CI using
monkeypatch to simulate the missing platform attributes.
Additional context
This is a follow-up to #92. The fixes and these regression tests will be submitted together in a single PR so the guards and their verification land atomically.
No code change is needed in the production files — only new test cases in tests/test_sandbox.py or a new tests/runtime/sandbox/test_guards_windows.py.
Describe the bug
There is no existing test coverage for
_classify_worker_death()insrc/nooa/runtime/sandbox/executor.pyor for the platform-guard behaviour ofprobe_capabilities()/apply_rlimits()insrc/nooa/runtime/sandbox/guards.py.Both functions were patched in #92 to guard against missing POSIX-only constants (
signal.SIGXCPU,signal.SIGKILL) and the missingresourcemodule on Windows. Without regression tests, any future refactor could silently revert those guards and the bugs would return undetected — CI would not catch it because the suite runs only on Linux today (see #95).What's missing
_classify_worker_death()with a simulated Windows environment (i.e.signal.SIGXCPU/signal.SIGKILLabsent).probe_capabilities()withresourceabsent and assertsrlimit=Falseis returned instead of a crash.apply_rlimits()withresourceabsent and asserts it returns early rather than raisingModuleNotFoundError.Confirmed by searching
tests/— zero hits for_classify_worker_death,SIGXCPU,SIGKILL, orWorkerDiedErrorin a death-classification context.Expected behavior
Regression tests that:
monkeypatch.delattrto simulate a Windowssignalmodule (removeSIGXCPUandSIGKILL) and assert_classify_worker_death()falls through cleanly without raisingAttributeError.monkeypatchto makeimport resourceraiseImportErrorand assertprobe_capabilities()returnsCapabilities(..., rlimit=False)without crashing.apply_rlimits()— assert it returns early whenresourceis unavailable.Environment
monkeypatchto simulate the missing platform attributes.Additional context
This is a follow-up to #92. The fixes and these regression tests will be submitted together in a single PR so the guards and their verification land atomically.
No code change is needed in the production files — only new test cases in
tests/test_sandbox.pyor a newtests/runtime/sandbox/test_guards_windows.py.