Skip to content

fix: fail quickly if a subprocess returns 1#2165

Merged
sofisl merged 7 commits intomasterfrom
failQuickly
Mar 3, 2026
Merged

fix: fail quickly if a subprocess returns 1#2165
sofisl merged 7 commits intomasterfrom
failQuickly

Conversation

@sofisl
Copy link
Contributor

@sofisl sofisl commented Mar 2, 2026

In Python, os.system() executes a command in a subshell. While the command itself (like python3 owlbot.py) returns a non-zero exit code when it crashes, os.system() simply returns that value to the caller and continues execution of the script.

Because the main script (Step #5 in your logs) finished its loop without explicitly checking the return value of system() and calling sys.exit(1), Cloud Build marked Step #5 as "Finished" successfully.

other thing in this PR is adding a build script for dev purposes, you can run build.sh and test locally more easily

@sofisl sofisl requested review from a team as code owners March 2, 2026 21:31
@sofisl sofisl changed the title chore: fail quickly if a subprocess returns 1 fix: fail quickly if a subprocess returns 1 Mar 2, 2026
sofisl added 2 commits March 2, 2026 14:57
Add check=True to subprocess calls for better error handling.
@sofisl sofisl requested a review from codyoss March 2, 2026 22:59
@sofisl sofisl requested a review from codyoss March 2, 2026 23:29
@codyoss codyoss added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Mar 3, 2026
@sofisl sofisl enabled auto-merge (squash) March 3, 2026 18:34
@sofisl sofisl added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Mar 3, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 3, 2026
@sofisl sofisl merged commit d043b5a into master Mar 3, 2026
12 checks passed
@sofisl sofisl deleted the failQuickly branch March 3, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants