Skip to content

Verify local task process-group cleanup - #22

Open
rzaitov wants to merge 2 commits into
mainfrom
prod-5
Open

Verify local task process-group cleanup#22
rzaitov wants to merge 2 commits into
mainfrom
prod-5

Conversation

@rzaitov

@rzaitov rzaitov commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Application-PR: semaphoreui/semaphore#4228

Summary

Add end-to-end API coverage for local task process-group cleanup on Linux. The tests use the existing core-sqlite-local profile and exercise normal completion, graceful cancellation, forced escalation, and the process-group cleanup boundary.

Each scenario uses a second Semaphore task for verification and cleanup. The main task records process IDs in plain text files, which the verifier reads to inspect process state, make assertions, and remove survivors. This keeps process inspection inside Semaphore task execution and avoids relying on host PIDs or docker exec.

Behavior

The normal-completion scenario verifies that descendants in the task's process group are removed when the main command exits successfully.

The graceful-stop scenario verifies that cancellation sends SIGTERM to the process group and gives cooperative processes time to exit.

The resistant-stop scenario verifies that processes which remain running are removed after the grace period.

The escaped-process-group scenario verifies the cleanup boundary: a descendant that creates another process group can survive task cleanup. The test removes the escaped process afterward.

Add a local API integration scenario that completes a Bash task while a
signal-resistant descendant keeps inherited output pipes open.

Run a follow-up task in the same container to verify that the descendant
was removed and clean up any unexpected survivor. Also assert
successful, prompt completion and preserved stdout and stderr markers.
Add API scenarios for graceful SIGTERM handling, SIGKILL escalation
after the grace period, and descendants that escape into a new process
group.

Isolate each process topology in its own fixture directory and use
follow-up verifier tasks to confirm process state and clean up
intentional or unexpected survivors. Assert task status, signal
delivery, and shutdown timing where applicable.
@rzaitov rzaitov self-assigned this Sep 10, 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.

1 participant