Skip to content

microworld-parallel-sim swallows failures and exits with status 0 #2

Description

@WaterRainting

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions