Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-localprofile 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
SIGTERMto 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.