ci(molecule): a hung scenario hides every scenario's log behind the job timeout #474

Open
opened 2026-11-29 11:25:58 +00:00 by Claude · 0 comments
Owner

Problem

scripts/run_molecule_scenarios.sh prints each scenario's log group only after every lane has finished. When one scenario hangs, its lane holds until the Molecule job's timeout-minutes. The runner then cancels the step, and no group is printed, so the log shows neither where the hung scenario stopped nor why any other scenario failed.

Run 6604 is an example. traefik/default was still running after 89 minutes when the job timed out, and system_baseline/default had failed with exit 2. The job log has only the finished <label>: exit N after S s lines. A rerun of the same commit passed in 30 minutes.

Printing the logs from the script's signal trap is unlikely to help: the runner seems to stop capturing the step's output once it cancels it.

Out of scope: why that run hung.

Proposal

Run each molecule test under coreutils timeout, with a per-scenario limit well below the job's timeout. The limit defaults to 30 min against about 8.5 min for the longest scenario today, and MOLECULE_SCENARIO_TIMEOUT (seconds) overrides it.

A hung scenario then fails on its own with exit 124. Its containers are removed as for any other failure, and its partial log prints in its group while the job is still alive. The lane is freed, so the rest of the run finishes and reports.

Acceptance criteria

  • A test in tests/scripts/test_run_molecule_scenarios.py shows that a scenario running past the limit is stopped and reported as failed, that its partial log is printed, and that the other scenarios still run and report.
  • A test holds the default limit below the Molecule job's timeout-minutes.
  • python3 -m unittest discover -s tests/scripts passes.
  • pre-commit run --all-files passes.
  • The full Molecule run in CI passes.

Assisted-by: Claude Code

### Problem `scripts/run_molecule_scenarios.sh` prints each scenario's log group only after every lane has finished. When one scenario hangs, its lane holds until the Molecule job's `timeout-minutes`. The runner then cancels the step, and no group is printed, so the log shows neither where the hung scenario stopped nor why any other scenario failed. Run 6604 is an example. `traefik/default` was still running after 89 minutes when the job timed out, and `system_baseline/default` had failed with exit 2. The job log has only the `finished <label>: exit N after S s` lines. A rerun of the same commit passed in 30 minutes. Printing the logs from the script's signal trap is unlikely to help: the runner seems to stop capturing the step's output once it cancels it. Out of scope: why that run hung. ### Proposal Run each `molecule test` under coreutils `timeout`, with a per-scenario limit well below the job's timeout. The limit defaults to 30 min against about 8.5 min for the longest scenario today, and `MOLECULE_SCENARIO_TIMEOUT` (seconds) overrides it. A hung scenario then fails on its own with exit 124. Its containers are removed as for any other failure, and its partial log prints in its group while the job is still alive. The lane is freed, so the rest of the run finishes and reports. ### Acceptance criteria - [ ] A test in `tests/scripts/test_run_molecule_scenarios.py` shows that a scenario running past the limit is stopped and reported as failed, that its partial log is printed, and that the other scenarios still run and report. - [ ] A test holds the default limit below the Molecule job's `timeout-minutes`. - [ ] `python3 -m unittest discover -s tests/scripts` passes. - [ ] `pre-commit run --all-files` passes. - [ ] The full Molecule run in CI passes. Assisted-by: Claude Code
Claude added this to the CI velocity (emergency) milestone 2026-11-29 11:25:58 +00:00
Claude added the Kind/Enhancement
Status
Needs Triage
labels 2026-11-29 11:25:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#474