Skip to content

169 - Wait for aborted process exit before finalising schedule - #169

Closed
louis-pie wants to merge 1 commit into
mainfrom
AP-2830-harden-pipelinewise-deploys-h
Closed

169 - Wait for aborted process exit before finalising schedule#169
louis-pie wants to merge 1 commit into
mainfrom
AP-2830-harden-pipelinewise-deploys-h

Conversation

@louis-pie

@louis-pie louis-pie commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Related to AP-2830

Context

Cicada currently clears is_running and finalizes the schedule log immediately after abort_running sends SIGTERM, even though the launched process may still be running.

This is a minimal, human-reviewable alternative to #167 and is intended to replace it. It starts from current main and implements only the essential wait-for-exit behavior, without the broader process-supervision refactor from #167.

Refer to 0.10.4 CHANGELOG for full details.

Changes

  • Keep an aborted schedule marked as running until its launched process exits.
  • Clear additional abort requests while the process is stopping so they cannot affect the next run.

Test coverage

  • Existing: 2 cases related to abort_running, 5 covering broader exec_schedule behavior.
  • New: 1 case related to abort_running, 0 covering broader exec_schedule behavior.
  • Updated: 1 case related to abort_running, 0 covering broader exec_schedule behavior. It now confirms is_running and abort_running are cleared after the process exits.
  • Deleted: None.

Validation

  • make pytest: 142 passed, 78.12% coverage
  • make flake8: passed with 0 errors
  • make black: passed

AP-2830

@louis-pie louis-pie changed the title Wait for aborted process exit before finalizing schedule Wait for aborted process exit before finalising schedule Aug 12, 2026
@louis-pie louis-pie changed the title Wait for aborted process exit before finalising schedule 169 - Wait for aborted process exit before finalising schedule Aug 12, 2026
@louis-pie
louis-pie marked this pull request as ready for review August 12, 2026 14:03
@louis-pie
louis-pie requested a review from a team as a code owner August 12, 2026 14:03
Copilot AI lite review requested due to automatic review settings August 12, 2026 14:03
@platon-github-app-production

Copy link
Copy Markdown

Comment /request-review to automatically request reviews from the following teams:

You can also request review from a specific team by commenting /request-review team-name, or you can add a description with --notes "<message>"

💡 If you see something that doesn't look right, check the configuration guide.

@wise-github-bot-app

Copy link
Copy Markdown

This is currently a non-blocking check, and it will not prevent your Pull Request from being merged.

The CODEOWNER of this repository has some untagged assets.

As this is a public repository, asset details will not be shown.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Changes: Bugfix (1), Test improvement (1), Documentation update (1), Maintenance (1)

This PR adjusts exec_schedule so an abort_running request no longer clears is_running / finalizes the schedule log until the launched child process has actually exited, preventing the scheduler from considering a schedule “free” while its prior process is still alive.

Changes:

  • Keep an aborted schedule marked as running until the child process exits; consume repeated abort_running requests while waiting.
  • Add/extend tests to assert running/abort flags are cleared only after process exit.
  • Update release metadata (changelog/version) and adjust local pytest coverage threshold (currently lowered).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cicada/commands/exec_schedule.py Tracks whether an abort was received and waits for child exit before finalizing, while clearing repeated abort requests during shutdown.
tests/test_exec_schedule.py Adds a focused unit test asserting termination happens before unset_is_running and finalize_schedule_log.
tests/test_functional_main.py Extends an existing functional abort test to also assert is_running and abort_running are cleared after exit.
CHANGELOG.md Adds 0.10.4 notes describing the abort-wait behavior and related test changes (and mentions reducing coverage threshold).
setup.py Bumps package version to 0.10.4.
Makefile Lowers --cov-fail-under from 78 to 75 (flagged for change).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Makefile
Comment on lines 19 to +22
pytest:
cd $(mkfile_path) ;\
. venv/bin/activate ;\
pytest tests/ --verbose --cov=cicada --cov-fail-under=78 --cov-report term-missing
pytest tests/ --verbose --cov=cicada --cov-fail-under=75 --cov-report term-missing
Comment thread CHANGELOG.md
Comment on lines +9 to +13
Tests and CI
~~~~~~~~~~~~
- Add coverage that an aborted schedule is finalized only after its process exits
- Update the existing abort test to confirm the running and abort flags are cleared after process exit
- Set the minimum test coverage to 75%
@louis-pie

Copy link
Copy Markdown
Collaborator Author

will instead merge #167

@louis-pie louis-pie closed this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants