ci(molecule): stop a scenario that runs past its own time limit #475
Open
Claude
wants to merge 2 commits from
ci/474-scenario-timeout into main
pull from: ci/474-scenario-timeout
merge into: Mortis:main
Mortis:main
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Needs Triage
Maintainer needs to evaluate this issue
Status
Ready for Agent
Fully specified, ready for an AFK agent
Status
Ready for Human
Requires human implementation
Wayfinder
Grilling
Decision ticket resolved in conversation with the maintainer
Wayfinder
Map
Wayfinder map: index of a planning effort and its decision tickets
Wayfinder
Prototype
Decision ticket resolved by reacting to a rough concrete artifact
Wayfinder
Research
Decision ticket resolved by reading outside sources
Wayfinder
Task
Manual work that must happen before a decision can be made
No labels
Milestone
No items
No Milestone
CI velocity (emergency)
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Mortis/Kamino#475
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Closes #474
A Molecule scenario that hung held its lane until the job's 90-minute timeout. The cancel then lost every scenario's log, because the script prints the log groups only after all lanes finish.
Now each
molecule testruns undertimeout --foreground --kill-after=30, with a per-scenario limit of 1800 s thatMOLECULE_SCENARIO_TIMEOUToverrides for local runs and tests. A hung scenario fails on its own while the job is still alive. Its log, with atimed out after N sline, prints in its group, and the lane goes on to the next scenario.--foreground: it keepstimeoutand molecule in the script's process group, so a cancel that kills the group still reaches them. Without it,test_a_killed_process_group_takes_its_lanesfails.ansible-playbookand workers keep running until the run container ends, and any container they recreate late is removed by the "Remove this run's containers" step. The script comment says so..gitea/workflows/AGENTS.mdnow covers the limit, with its Why and the two tests that hold it.Verified
python3 -m unittest discover -s tests/scriptspasses: 301 tests, run with the repo venv, which has molecule. The new tests are:test_a_scenario_past_its_time_limit_fails_alone: on one lane, a stalled scenario is stopped after 2 s. It is reported failed with its partial log and the timed-out line, its container is removed, and the next scenario still runs, which shows the lane is freed.test_the_default_time_limit_is_inside_the_job_timeouttest_the_time_limit_must_be_a_positive_integerpre-commit run --all-filespasses, andansible-test sanitypassed on push.Not verified
NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.