Summary
The package-level microworld-parallel-sim entrypoint catches SystemExit from the async simulation runner and then always returns 0.
Affected code
src/microworld/cli/parallel_simulation.py
src/microworld/simulation/parallel_simulation_main.py
In parallel_simulation.py, SystemExit is caught and ignored:
except SystemExit:
pass
...
return 0
But parallel_simulation_main.py intentionally exits with non-zero status for failures, for example:
- missing config file:
sys.exit(1)
- invalid topology cluster config:
sys.exit(2)
Why this matters
Shell scripts, CI, and parent orchestration code can treat a failed simulation as successful when using the package script entrypoint.
Expected behavior
microworld-parallel-sim should preserve the non-zero exit code from the underlying runner.
Suggested fix
Capture SystemExit as exc and return int(exc.code or 0), or let the exception propagate after cleanup.
Summary
The package-level
microworld-parallel-simentrypoint catchesSystemExitfrom the async simulation runner and then always returns0.Affected code
src/microworld/cli/parallel_simulation.pysrc/microworld/simulation/parallel_simulation_main.pyIn
parallel_simulation.py,SystemExitis caught and ignored:But
parallel_simulation_main.pyintentionally exits with non-zero status for failures, for example:sys.exit(1)sys.exit(2)Why this matters
Shell scripts, CI, and parent orchestration code can treat a failed simulation as successful when using the package script entrypoint.
Expected behavior
microworld-parallel-simshould preserve the non-zero exit code from the underlying runner.Suggested fix
Capture
SystemExit as excand returnint(exc.code or 0), or let the exception propagate after cleanup.