Skip to content

Commit 5eb50e7

Browse files
critesjoshclaude
andcommitted
fix: add process.exit() to scripts to prevent CI hangs
Scripts were not exiting after completion because open connections (WebSocket/HTTP to Aztec node) kept the Node.js event loop alive. This caused the CI workflow to hang indefinitely on the "Run local network scripts" step. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 744cedd commit 5eb50e7

File tree

7 files changed

+38
-9
lines changed

7 files changed

+38
-9
lines changed

scripts/deploy_account.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ export async function deployAccount() {
77
await deploySchnorrAccount();
88
}
99

10-
deployAccount();
10+
deployAccount()
11+
.then(() => process.exit(0))
12+
.catch((error) => {
13+
console.error("Error:", error);
14+
process.exit(1);
15+
});

scripts/deploy_contract.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ async function main() {
7777
logger.info(` - Sponsored FPC: ${sponsoredFPC.address}`);
7878
}
7979

80-
main().catch((error) => {
80+
main()
81+
.then(() => process.exit(0))
82+
.catch((error) => {
8183
const logger = createLogger('aztec:aztec-starter');
8284
logger.error(`❌ Deployment failed: ${error.message}`);
8385
logger.error(`📋 Error details: ${error.stack}`);
8486
process.exit(1);
85-
});
87+
});

scripts/fees.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,12 @@ async function main() {
163163
logger.info(`Transfer paid with fees from Sponsored FPC.`)
164164
}
165165

166-
main();
166+
main()
167+
.then(() => process.exit(0))
168+
.catch((error) => {
169+
console.error("Error:", error);
170+
process.exit(1);
171+
});
167172

168173
// from here: https://github.com/AztecProtocol/aztec-packages/blob/ecbd59e58006533c8885a8b2fadbd9507489300c/yarn-project/end-to-end/src/fixtures/utils.ts#L534
169174
function getL1WalletClient(rpcUrl: string, index: number) {

scripts/get_block.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@ async function main() {
1111
console.log(await block?.hash())
1212
}
1313

14-
main();
14+
main()
15+
.then(() => process.exit(0))
16+
.catch((error) => {
17+
console.error("Error:", error);
18+
process.exit(1);
19+
});

scripts/interaction_existing_contract.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ async function main() {
100100
logger.info("To join this game, another player would call join_game with the same game ID.");
101101
}
102102

103-
main().catch((error) => {
103+
main()
104+
.then(() => process.exit(0))
105+
.catch((error) => {
104106
console.error("Error:", error);
105107
process.exit(1);
106-
});
108+
});

scripts/multiple_wallet.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,9 @@ async function main() {
133133

134134
}
135135

136-
main();
136+
main()
137+
.then(() => process.exit(0))
138+
.catch((error) => {
139+
console.error("Error:", error);
140+
process.exit(1);
141+
});

scripts/profile_deploy.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,9 @@ async function main() {
2323
console.dir(profileTx, { depth: 2 });
2424
}
2525

26-
main();
26+
main()
27+
.then(() => process.exit(0))
28+
.catch((error) => {
29+
console.error("Error:", error);
30+
process.exit(1);
31+
});

0 commit comments

Comments
 (0)