Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/spartan-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
run: |
earthly-ci ./yarn-project+export-e2e-test-images

network-e2e:
test:
needs: [build, changes]
if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }}
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
success-check:
runs-on: ubuntu-20.04
needs:
- build-and-test
- test
if: always()
steps:
- name: Report overall success
Expand Down
4 changes: 3 additions & 1 deletion yarn-project/aztec/src/bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ async function main() {
main().catch(err => {
debugLogger.error(`Error in command execution`);
debugLogger.error(err + '\n' + err.stack);
process.exit(1);
// See https://nodejs.org/api/process.html#processexitcode
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this because I saw logs where this was getting hit but the process wasn't exiting.

Rather than calling process.exit() directly, the code should set the process.exitCode and allow the process to exit naturally by avoiding scheduling any additional work for the event loop
If it is necessary to terminate the Node.js process due to an error condition, throwing an uncaught error and allowing the process to terminate accordingly is safer than calling process.exit().

process.exitCode = 1;
throw err;
});