socket icon indicating copy to clipboard operation
socket copied to clipboard

Wait for console.log to flush before exiting

Open bcomnes opened this issue 2 years ago • 5 comments

When you have a console.log right before a process.exit, the console.log output is often not printed before the process exits. We should wait for console.log and other similar things to finish flushing before exiting.

bcomnes avatar Aug 18 '23 18:08 bcomnes

@bcomnes is it something socket:test-related?

chicoxyzzy avatar Aug 21 '23 16:08 chicoxyzzy

It probably would affect socket test as well, but I encountered it when doing a headless CLI.

https://github.com/socketsupply/socket-extension-operator-deploy/blob/75f6ccc66da5321a5c0004cac513a702a03a94b8/migrate-tool/src/index.js#L14-L57

Basically, if if you console.log and then shortly thereafter run process.exit, you will not see the console.log output.

bcomnes avatar Aug 21 '23 16:08 bcomnes

I recently experienced this as well

heapwolf avatar Aug 21 '23 16:08 heapwolf

This is an issue with how we query OSLogStore on macOS

jwerle avatar Aug 31 '23 19:08 jwerle

This issue makes it hard to understand when something is failing on CI or when running the test app locally, we need to make it a high priority for next release

chicoxyzzy avatar Nov 21 '23 14:11 chicoxyzzy