Repository navigation
fix: exit non-zero from makestudy and makedocker on failure - #680
Open
chikolavosaki-sys wants to merge 1 commit into
Open
chikolavosaki-sys wants to merge 1 commit into
chikolavosaki-sys wants to merge 1 commit into
Conversation
makestudy and makedocker ended their error paths with a bare `exit`, which returns the status of the preceding `echo`, so they exited 0 when the graphml was missing, the study directory already existed, or no arguments were given. makedocker's "already exists" branch had no exit at all. They now exit 1 on these paths.
chikolavosaki-sys
force-pushed
the
fix/makestudy-exit-codes
branch
from
November 13, 2026 12:12
06666c2 to
87fe7ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #679
Problem:
makestudyandmakedockerexit 0 when they fail. Every error path ends with a bareexit, which returns the status of theechojust before it. Inmakedocker, the "already exists" branch has noexitat all and falls through to the end of the script. As a result, the FRI server (fri/server/main.py,/build) treats a failed study creation as a success. It runs these scripts withsubprocess.check_output, which only raises on a non-zero exit code, so it returns 201 "Directory successfully created" even though nothing was created.Steps to reproduce (dev @ 8f3e444, Ubuntu 24.04 on WSL2):
Change: the error paths now
exit 1. This covers a missing graphml, an existing study directory, and no arguments, in both scripts. The no-arguments case matchesmkconcore.py, which already callssys.exit(1)when it gets too few arguments. The success path is unchanged: the script still ends withpython3 mkconcore.py, so mkconcore's own exit code is passed through as before.makestudy.batandmakedocker.bathave no checks of their own and end with the mkconcore call, so I left them alone. I could not test them on Windows.Testing:
tests/test_makestudy_exit_codes.py: 6 tests covering the 3 failure cases for each script. The "already exists" case uses a pytesttmp_path, so nothing is created in the repo. All 6 fail on current dev and pass with this change.makestudy/makedockerstill exits 0, and that a mkconcore crash (unwritable output dir) still exits 1.subprocess.check_output(["./makestudy", "demo/does_not_exist"])now raisesCalledProcessError, so FRI returns its 500 error path.ruff checkandruff format --checkpass.