mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-03 10:18:18 +00:00
test(search-with-proof): the probe test prints its whole record when the status is not ok
The CI run ond68280b(run 46182501224) failed one test of the checks job whose cause its output does not name: tests/test_search_probe.py::test_task_boundary_probe_executes_packaged_pairs[real], with status instrument_failure. The assertion showed the record through pytest's short repr, which cuts it after a few keys. The test passes here in both environments, so the cause on the runner is still unknown. What changed - When the probe's status is not ok, the test prints the whole record as JSON before it asserts. A failed test shows what it printed, so the next run on GitHub names the cause. - The assertion message is the status. The record is in the printed output. - Nothing else: a passing run prints nothing, and the test skips on nothing new. Checks - s10_ci2_pytest.out: tests/test_search_probe.py, 16 passed in the project environment and 16 passed in a fresh environment from the lockfile (s10_lock_venv_sync.out). - s10_ci2_exits.txt: the gates with label ci2, ten zeros. s10_ci2_diffcheck.out: one file, +4 -1; git diff --check exits 0. - The s10 files are under /tmp/opencode, outside the repository. Not verified - The cause on the runner. The two refusals that CI met before (c4720ba) cannot come from the probe's own commands at the task boundary: the browser starts with --no-sandbox and without bwrap (oracles.py:210, 253-254, 261; verify.py:646), and the ssrf oracle starts no unshare (oracles.py:149-150; verify.py:404-405). - Why the test fails on the runner now: the search package is unchanged sinced26fbcb, where the test was not among the failures of run 45352669096. Review. Review, two rounds, read-only, 2026-11-28: tree approved. Round one removed its skip: it could neither fire in this test nor be trusted, since it matched the whole record while the exception names only the first mismatch. Round two is one hunk. Checked: nothing else in the file moved against HEAD; with the status ok nothing is printed (16 passed here, in both environments); in plain pytest a failing test shows the record under Captured stdout call and fails with the status (the same block on a record of the real probe.probe with a stubbed side task). The commands of the task boundary, captured without launching them: the browser starts with --no-sandbox and no bwrap (oracles.py:253-254 clears the list; the shorter list of :233 belongs to a root container), and the ssrf oracle starts no unshare (oracles.py:149-150). So the two old refusals cannot come from the probe's own commands there. Not verified: the run id and the cause on the runner.
This commit is contained in:
@@ -166,7 +166,10 @@ def test_task_boundary_probe_executes_packaged_pairs(tmp_path, monkeypatch, name
|
|||||||
monkeypatch.setattr(probe._sandbox, "isolation_check", lambda **kw: pytest.fail("task boundary must skip preflight"))
|
monkeypatch.setattr(probe._sandbox, "isolation_check", lambda **kw: pytest.fail("task boundary must skip preflight"))
|
||||||
monkeypatch.setattr(probe, "verify", lambda *a, **kw: pytest.fail("must use task executor"))
|
monkeypatch.setattr(probe, "verify", lambda *a, **kw: pytest.fail("must use task executor"))
|
||||||
record = probe.probe(tmp_path)
|
record = probe.probe(tmp_path)
|
||||||
assert record["status"] == "ok", record
|
if record["status"] != "ok":
|
||||||
|
# The status names no cause. The record does, and a failed test shows what it printed.
|
||||||
|
print(json.dumps(record, indent=2, sort_keys=True, default=str))
|
||||||
|
assert record["status"] == "ok", record["status"]
|
||||||
assert record["isolation_check"] == {"status": "skipped", "reason": "task-boundary"}
|
assert record["isolation_check"] == {"status": "skipped", "reason": "task-boundary"}
|
||||||
assert record["isolation_mode"] == "task-boundary"
|
assert record["isolation_mode"] == "task-boundary"
|
||||||
assert record["namespaces"] == namespace_diagnostics
|
assert record["namespaces"] == namespace_diagnostics
|
||||||
|
|||||||
Reference in New Issue
Block a user