Cleanup benchmark code#21060
Conversation
| } | ||
| } | ||
|
|
||
| process.on('exit', cleanup); |
There was a problem hiding this comment.
cleanup handlers can't be async, so I moved the cleanup into a try-finally.
It doesn't allow us to capture Control+C, but 🤷 seems low stakes
Estimated Asset SizesDiff Details
|
| reuse: REUSE, | ||
| }); | ||
|
|
||
| console.log(`\nWrote report: ${result.msgFile}`); |
|
|
||
| await cleanup(); | ||
|
|
||
| return { |
There was a problem hiding this comment.
No other functions that depend on the return value of runBenchmark?
There was a problem hiding this comment.
the primary output is via the CLI's stdout, and then the output reports
| } | ||
|
|
||
| process.on('exit', cleanup); | ||
| process.on('SIGINT', () => { |
There was a problem hiding this comment.
Is this okay to be removed? When users do ctrl c to exit?
There was a problem hiding this comment.
I don't know how to synchronously kill servers -- which like.. I guess I could do with spawnSync / execSync, but that then needs a lot more code to gracefully handle exceptions, stdio/etc.
these event handlers can't be async, so that's why I removed the code -- it's likely they weren't working anyway

No description provided.