Skip to content

Bring the RegressionTests Python Tools Under the Interrupt Rule #1293

Done

Description

@ptr727

The RegressionTests/ Python tools were edited by #1289 and #1292, so each one owes CODESTYLE.md "Interrupts" and "Interrupts in Python". A script takes that rule when it is next edited. None of these tools has interrupt handling yet. This is a review finding from the develop -> main promotion #1291, deferred past it by the maintainer.

Tools and what each owes

  • audit_physical.py: rewrites reduced/catalog.json in place. Write beside the target, then os.replace.
  • catalog_corpus.py: writes catalog.json directly. Write beside the target, then os.replace.
  • check_results.py: --write overwrites the expected-results file directly. Write beside the target, then os.replace.
  • locate_issue.py: full_decode_locate starts docker run with subprocess.Popen. Stop that child with terminate() and wait() in a finally.
  • reduce_corpus.py: process_clip runs the container with subprocess.run. Stop that child on interrupt.
  • synthetic/synthesize.py: stop its media-tool children on SIGTERM.

Each tool also takes the shared shape the injectors already use, in synthetic/hevc_nal.py run_injector:

  • a SIGTERM handler that records the signal and raises KeyboardInterrupt
  • a single KeyboardInterrupt catch that prints one line naming the signal and exits 130 or 143
  • no traceback

A shared helper beside corpus_common.py would keep the six from repeating it.

Tests

  • A mid-run signal test for each tool that holds a child process or a temporary path, as CODESTYLE.md requires. Each one asserts the exit status and that nothing the tool held remains. Skip each on Windows.
  • A test of the harness's CheckMountpoint refusal path in ProvisionDatasetTests, where the stub zfs reports a mountpoint other than REGRESSION_TEST_MEDIA. The run should exit 2 before any rollback, rename, or clone. Copilot asked for this on Promote Develop: Generic Regression Harness and SEI Script Arguments #1291.

Activity

  1. added
    pre-existing
    on Nov 26, 2026
  2. ptr727 commented on Nov 26, 2026

    @ptr727
    OwnerAuthor

    The whole-diff local review of promotion #1291 raised four more items, and the maintainer folded them in here as well:

    • RegressionTests/tests/test_help.py ProvisionDatasetTests: add a case where the existing test dataset's origin is -, meaning it is not a corpus clone. Assert exit 2 and no rename, clone, or destroy, which drives the refusal in ProvisionDataset.
    • RegressionTests/tests/test_help.py: HarnessTests, HarnessSignalTests, and ProvisionDatasetTests skip only on win32, though their reason says Linux. On macOS, bash 3.2 fails at declare -A and reads source <(...) as empty. Skip them unless sys.platform starts with linux, since the harness is Linux-only.
    • RegressionTests/tests/test_help.py: the module docstring covers only --help and argument handling. Either widen it, or move the harness signal and provisioning classes into their own test_regression_harness.py.
    • Docs/ClosedCaptions.md:66: "It also requires a temporary TS file on disk" reads as a second requirement. Word it as the consequence it is: piping is unreliable, so a temporary TS file on disk is used as standard input.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pre-existing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions