You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "zjncs (via GitHub)" <gi...@apache.org> on 2026/10/08 16:24:12 UTC

[PR] test(ai): pin the CLI binary availability probe contract [rocketmq-dashboard]

zjncs opened a new pull request, #5735:
URL: https://github.com/apache/rocketmq-dashboard/pull/5735

   ### What
   
   `CliBinaryProbe` — the shared probe that answers "is this CLI on PATH in the runtime image?" for the agent CLIs and the rmqctl MCP transport — had no test. This adds `CliBinaryProbeTest` with 7 tests.
   
   ### What is pinned
   
   - a zero exit within the budget means available; a non-zero exit means unavailable;
   - **a timeout means unavailable and the hung shell is destroyed forcibly** — a missing rmqctl must degrade a conversation to plain chat rather than fail it, so guessing yes is worse than guessing no;
   - an I/O failure and an interrupt both mean unavailable, and the interrupt **restores the thread's interrupt flag**;
   - **the isolated environment stays in the probe path** — the injected seam is the point: a probe that reached for a public method would silently bypass the recording environment, and the isolation tests would keep passing while testing nothing;
   - the probe runs `sh -c 'command -v <binary>'` with stderr merged into stdout.
   
   ### Verification
   
   - New tests on unmodified code: **7/7 green**, checkstyle clean (`mvn test -Dtest=CliBinaryProbeTest`).
   - Discriminating mutations on `CliBinaryProbe`, build result verified red each time:
     1. a timeout treated as available — red;
     2. the environment seam dropped from the path — red;
     3. an exception treated as available — red.
   - Restored: 7/7 green. Test-only change; no product code touched.
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org