Skip to content

Commit

Permalink
errors lead to consistent exit code in issue detail (vercel/turborepo…
Browse files Browse the repository at this point in the history
…#4716)

### Description

issue snapshots are flaky due to alternating issue detail with exist
code or not.

It's a race condition between process exit after sending error and
process killing after receiving error.
  • Loading branch information
sokra authored Apr 26, 2023
1 parent 604638f commit 1b0d0d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion crates/turbopack-node/js/src/ipc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ function createIpc<TIncoming, TOutgoing>(
});
} catch (err) {
// ignore and exit anyway
process.exit(1);
}
process.exit(1);
process.exit(0);
},
};
}
Expand Down
4 changes: 3 additions & 1 deletion crates/turbopack-node/src/render/issue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ impl Issue for RenderingIssue {
let mut details = vec![];

if let Some(status) = self.status {
details.push(format!("Node.js exit code: {status}"));
if status != 0 {
details.push(format!("Node.js exit code: {status}"));
}
}

Ok(StringVc::cell(details.join("\n")))
Expand Down

0 comments on commit 1b0d0d1

Please sign in to comment.