electron/spec/fixtures/api/utility-process
trop[bot] f29559e46c
fix: possible timing issue in utility-process spec (#45727)
This fixture has been calling process.exit() immediately after writing
to stdout and stderr, which the Node.js docs say is risky behavior:

> Calling process.exit() will force the process to exit as quickly as
> possible even if there are still asynchronous operations pending that
> have not yet completed fully, including I/O operations to
> process.stdout and process.stderr.

This fixture's been around for years without problems (AFAIK).
The writes are very small ('hello\n' and 'world') and finish quickly.
But recently I've been testing on a very slow CI machine. There, I see
this spec flaking when it expects stderr to be 'world' but it gets ''.

This PR changes the fixture to wait for stdout & stderr to flush
before calling process.exit().

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-02-20 08:55:02 +01:00
..
env-app build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
inherit-stderr build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
inherit-stdout build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
api-net-spec.js build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
crash.js feat: UtilityProcess API (#34980) 2022-10-19 22:49:49 -07:00
custom-exit.js feat: UtilityProcess API (#34980) 2022-10-19 22:49:49 -07:00
dns-result-order.js build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
empty.js feat: UtilityProcess API (#34980) 2022-10-19 22:49:49 -07:00
endless.js feat: UtilityProcess API (#34980) 2022-10-19 22:49:49 -07:00
esm.mjs fix: support esm entrypoint to utility process (#40047) 2023-09-29 14:38:37 -07:00
eval.js fix: crash in utilityProcess when generating code from strings (#38014) 2023-04-20 09:27:02 +09:00
exception.js chore: cleanup eslint suppressions (#38417) 2023-05-25 10:09:17 +09:00
exception.mjs fix: support esm entrypoint to utility process (#40047) 2023-09-29 14:38:37 -07:00
expose-main-process-module.js feat: expose system preferences to utility process (#42203) 2024-06-20 11:15:57 -04:00
external-ab-test.js feat: add error event for utility process (#43774) 2024-09-27 10:17:06 +09:00
log.js fix: possible timing issue in utility-process spec (#45727) 2025-02-20 08:55:02 +01:00
net.js build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
non-cloneable.js fix: MessagePort closing unexpectedly with non-cloneable objects (#42535) 2024-06-19 11:27:07 +02:00
oom-grow.js fix: support for v8.setHeapSnapshotNearHeapLimit api (#45632) 2025-02-17 13:23:38 +09:00
post-message-queue.js feat: UtilityProcess API (#34980) 2022-10-19 22:49:49 -07:00
post-message.js feat: UtilityProcess API (#34980) 2022-10-19 22:49:49 -07:00
preload.js feat: UtilityProcess API (#34980) 2022-10-19 22:49:49 -07:00
receive-message.js feat: UtilityProcess API (#34980) 2022-10-19 22:49:49 -07:00
suid.js build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00