myxce/.wolf/bugs/bug-1709.md
Rongsong Shen 4c13412720
chore: sync harness batch and bug-1872/1874-1877 to Gitea (#298-#315)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 04:42:34 +00:00

44 lines
1.8 KiB
Markdown

---
id: "bug-1709"
status: "fixed"
status_updated: "2026-09-28"
status_note: ""
component: "controller"
severity: "unknown"
timestamp: "2026-08-26T09:32:18Z"
last_seen: "2026-09-19T09:00:00Z"
occurrences: 1
files: ["src/harness/test.c"]
tags: ["controller", "testsuite", "xce_test", "cmd_jobinfo", "silent-failure", "exit-code", "cli-ux-audit"]
related: []
fix_commits: ["da1a663f"]
legacy: true
gitea_issue: 304
gitea_synced_status: "fixed"
gitea_synced_hash: "1e79d6a000e9"
---
# bug-1709: cmd_jobinfo always returns 0 (success) even when its -j jobid is malformed (parse_jobid's return…
## Description
cmd_jobinfo always returns 0 (success) even when its -j jobid is malformed (parse_jobid's return code is discarded), when no -j is given at all, or when xcecli_jobinfo fails for every -j given -- breaking the tool's own scripted-mode exit-code-verdict contract for this command specifically.
## Environment
_Not recorded (migrated from buglog.json)._
## Reproduction
_Not recorded (migrated from buglog.json)._
## Root cause
No error/found flag tracked across the -j loop; the function unconditionally `return 0`s regardless of whether any valid lookup succeeded.
## Fix
cmd_jobinfo counts the -j values given and the lookups that succeeded: a malformed jobid prints "invalid jobid", no -j prints "no jobid given", and the command fails unless at least one lookup succeeded.
## Verification
- Test: test_jobinfo_without_valid_jobid_fails in src/harness/testsuite/test_test_cli.c: RED before the fix (exit 0 for both `jobinfo` and `jobinfo -j garbage`), GREEN after
- Suites: harness 6/6 (asan): harness_unit_test 141/0, cmdutil 14/0, resval_typeresolve 7/0, joblist_display 22/0, join_worker_args 7/0, listrow_json 12/0
- Live: n/a; xce_test is a client tool and every case above runs without a controller
## References
_Not recorded (migrated from buglog.json)._