-
Notifications
You must be signed in to change notification settings - Fork 0
fix: retain crash ids and pointer-capture diagnostics #239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,3 +41,46 @@ def test_never_finishes(self): | |
| # Exercises the per-test watchdog under a short PRKS_E2E_TEST_WATCHDOG. | ||
| # Must not be collected by ordinary discovery (this module is not test_*). | ||
| time.sleep(3600) | ||
|
|
||
|
|
||
| class ClearedHeartbeatCrashCases(unittest.TestCase): | ||
| def test_passes_then_dies_after_heartbeat_clear(self): | ||
| """Finish the test's heartbeat, then die before the worker report. | ||
|
|
||
| Mirrors run_worker clearing the heartbeat in ``finally`` and exiting | ||
| before the report file exists. The log still names this test. | ||
| """ | ||
| from tests.e2e.harness import clear_e2e_heartbeat | ||
|
|
||
| clear_e2e_heartbeat() | ||
| os._exit(3) | ||
|
|
||
|
|
||
| class FailFastSiblingCases(unittest.TestCase): | ||
| """One worker fails only after its sibling has an active test id. | ||
|
|
||
| Used to prove --fail-fast cancellation does not record the stopped sibling | ||
| as a failed test. Not collected by ordinary discovery. | ||
| """ | ||
|
|
||
| # Parent fail-fast SIGTERMs this worker. The loop is the wait; surviving | ||
| # it means cancellation never arrived. | ||
| _CANCEL_WAIT_S = 8.0 | ||
|
|
||
| def test_runs_until_cancelled(self): | ||
| sentinel = os.environ.get("PRKS_E2E_CANCEL_SENTINEL") | ||
| if sentinel: | ||
| with open(sentinel, "w", encoding="utf-8") as handle: | ||
| handle.write("started") | ||
| deadline = time.monotonic() + self._CANCEL_WAIT_S | ||
| while time.monotonic() < deadline: | ||
| time.sleep(0.05) | ||
| self.fail("parent did not cancel this worker") | ||
|
|
||
| def test_fails_once_sibling_is_active(self): | ||
| sentinel = os.environ.get("PRKS_E2E_CANCEL_SENTINEL") | ||
| if sentinel: | ||
| deadline = time.time() + 15 | ||
| while time.time() < deadline and not os.path.exists(sentinel): | ||
| time.sleep(0.05) | ||
| self.assertEqual("expected", "actual") | ||
|
Comment on lines
+83
to
+86
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Require the sentinel before triggering the failure. If the sentinel does not appear within 15 seconds, this case still fails deliberately. A sibling that starts just afterward can create the sentinel before the caller checks the file, so the test can pass without proving that the sibling was active at failure time. Assert that the sentinel exists immediately after the wait and before 🤖 Prompt for AI AgentsSource: Path instructions |
||
Uh oh!
There was an error while loading. Please reload this page.