From 06af05e30e56364530e974c29c0d29d155d3882a Mon Sep 17 00:00:00 2001 From: ChengLong GU <88359731+gcl-coder@users.noreply.github.com> Date: Sat, 28 Nov 2026 09:43:28 +0800 Subject: [PATCH] test(quota): gate the capture-failure case on private capture support The regression models a POSIX privacy failure by loosening directory mode bits, which Windows cannot enforce, so the composed settlement correctly returns its unsupported-capture result and the test's nonzero-exit premise cannot hold. Skip the case where private capture is unavailable; the cross-platform unsupported contract remains covered by test_composed_settlement_keeps_commit_when_private_capture_is_unsupported. Refs #9398. Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com> --- tests/control_plane/test_refresh_settle_turn.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/control_plane/test_refresh_settle_turn.py b/tests/control_plane/test_refresh_settle_turn.py index bd455d8340..c96312e591 100644 --- a/tests/control_plane/test_refresh_settle_turn.py +++ b/tests/control_plane/test_refresh_settle_turn.py @@ -384,6 +384,16 @@ def test_exact_spend_and_refresh_reject_another_turns_debit_file( @pytest.mark.parametrize("provider", ["file", "sqlite"]) def test_receipt_capture_failure_keeps_committed_receipts_and_exact_retry(tmp_path, monkeypatch, provider): + from loopx.control_plane.turn_driver import decision_capture + + if not decision_capture.private_capture_supported(): + # This case models a real capture-privacy failure by loosening POSIX + # mode bits. Hosts without private capture support never reach that + # branch: the composed settlement returns the evaluated result inline + # with `quota_decision_capture_unsupported`, which + # test_composed_settlement_keeps_commit_when_private_capture_is_unsupported + # covers cross-platform. + pytest.skip("chmod cannot revoke private capture on this host") isolate_sqlite_runtime(tmp_path, monkeypatch) project, runtime, registry = _write_fixture(tmp_path) _initialize_fixture_authority(project, runtime, provider=provider)