Skip to content

Commit

Permalink
test(scaling): prevent node service from exiting
Browse files Browse the repository at this point in the history
  • Loading branch information
mkermani144 committed Apr 14, 2024
1 parent bfb3c76 commit 508df55
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions tests/scaling/src/node/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const messages = Array.from({ length: 1000 }).map(
(_, index) => `Ping#${index}:${process.env.NODE_PEER_ID!.slice(-5)}`,
);

setTimeout(async () => {
setInterval(async () => {
for (const message of messages) {
for (const peer of process.env.ALL_PEER_IDS!.split(',')) {
if (peer !== process.env.NODE_PEER_ID!) {
Expand All @@ -26,13 +26,4 @@ setTimeout(async () => {
}
}
}
setTimeout(() => {
process.exit(0);
}, 5000);
}, 10000);

// This timeout works like a Promise.race, if above process.exit is not called
// for some reason
setTimeout(() => {
process.exit(0);
}, 50000);

0 comments on commit 508df55

Please sign in to comment.