Skip to content

rov_mujoco:测试入口引用缺失文件,执行失败仍返回退出码 0 #140

Description

@zinniahhh

关联已合并 PR:#64。
复现版本:07ff3245bd1fc6e1c9d53c29a05707a5ae617b40。
环境:Ubuntu 20.04.6、Python 3.8.10,已安装 NumPy。
在仓库根目录执行:

python3 src/water/rov_mujoco/main.py --test2
echo $?
python3 src/water/rov_mujoco/main.py --test3
echo $?
python3 src/water/rov_mujoco/main.py --test4
echo $?

实际结果:三个命令分别报告 test_task2.py、test_task3.py、test_task4.py 不存在,但退出码全部为 0。这些选项也出现在 --help 中。

可能原因:入口使用 os.system(),然后直接 sys.exit(ret)。在 Ubuntu 下,子进程退出码 2 对应编码后的等待状态 512,直接用于退出会导致外部看到退出码 0。

建议:补齐测试文件或移除未实现的选项;使用 subprocess.run([...]).returncode 传递真实退出码,并提前检查文件存在。
@Syysean

Activity

  1. self-assigned this
    on Oct 1, 2026
  2. added a commit that references this issue on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions