zjncs opened a new pull request, #5677: URL: https://github.com/apache/rocketmq-dashboard/pull/5677
### Problem `AgentRunHandle` — the cancellation for one run that "finally makes stop mean something" (thread interrupts cannot kill an agent subprocess tree, per its own design docs) — had **no test**. ### Change Add `AgentRunHandleTest` with ten tests, exercised through fake `Process` objects (no real process is forked): | Contract | Pinned behaviour | | --- | --- | | registration race | a stop requested **before** the subprocess registered kills it the moment it attaches | | graceful first | a stop after registration sends SIGTERM; a process that exits within the grace is **never hard-killed** | | escalation | a process that survives the grace is hard-killed; one that survives even SIGKILL gets the bounded retry — `destroyForcibly` exactly **twice** | | exactly-once | the second `stop` caller is a no-op and never escalates a running grace period | | worker handoff | the worker future is cancelled only by the caller that owns the abort, and only after the process is dead | | guards | null grace → default; null process attachment ignored; null stop reason rejected | | isolation | two handles on the same run are independent — one run's stop never touches another run's process | ### Verification - New tests: **10/10 green** against unmodified code. - Discriminating mutations on `AgentRunHandle` (build result verified): the exactly-once CAS dropped (**red**); the attach-race kill dropped (**red**); the post-SIGKILL retry dropped (**red** once the retry count is pinned — a single `destroyForcibly` passes without that pin, which is why the pin exists); the worker cancel dropped (**red**). - Restored: 10/10 green. No product code changed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
