Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

ckerr
Copy link
Member

@ckerr ckerr commented Feb 19, 2025

Description of Change

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') so they 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().

I've read through the specs that touch log.js and AFAICT this fix doesn't change the semantics of any of spec, e.g. none of them are looking for an unfinished write().

Yes, I'm changing a three-line .js file. Bikesheds welcome. 😸

Checklist

Release Notes

Notes: none

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().
@ckerr ckerr added semver/patch backwards-compatible bug fixes ci-flake ⭕️ Issues specific to CI flakes, not bugs, if a bug happens to be related to a CI flake merge them target/32-x-y PR should also be added to the "32-x-y" branch. target/33-x-y PR should also be added to the "33-x-y" branch. target/34-x-y PR should also be added to the "34-x-y" branch. target/35-x-y PR should also be added to the "35-x-y" branch. labels Feb 19, 2025
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Feb 19, 2025
@dsanders11
Copy link
Member

Bikesheds welcome. 😸

With that invitation, seems more like a test: than a fix:. 😀

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Feb 20, 2025
@ckerr ckerr merged commit d6f4982 into main Feb 20, 2025
76 checks passed
@ckerr ckerr deleted the fix/timing-issue-in-utility-process-spec branch February 20, 2025 05:28
@release-clerk
Copy link

release-clerk bot commented Feb 20, 2025

No Release Notes

@trop
Copy link
Contributor

trop bot commented Feb 20, 2025

I have automatically backported this PR to "32-x-y", please check out #45726

@trop trop bot added in-flight/32-x-y and removed target/32-x-y PR should also be added to the "32-x-y" branch. labels Feb 20, 2025
@trop
Copy link
Contributor

trop bot commented Feb 20, 2025

I have automatically backported this PR to "35-x-y", please check out #45727

@trop
Copy link
Contributor

trop bot commented Feb 20, 2025

I have automatically backported this PR to "34-x-y", please check out #45728

@trop
Copy link
Contributor

trop bot commented Feb 20, 2025

I have automatically backported this PR to "33-x-y", please check out #45729

@trop trop bot added in-flight/35-x-y in-flight/34-x-y in-flight/33-x-y and removed target/35-x-y PR should also be added to the "35-x-y" branch. target/34-x-y PR should also be added to the "34-x-y" branch. target/33-x-y PR should also be added to the "33-x-y" branch. labels Feb 20, 2025
@trop trop bot added merged/34-x-y PR was merged to the "34-x-y" branch. merged/32-x-y PR was merged to the "32-x-y" branch. merged/35-x-y PR was merged to the "35-x-y" branch. merged/33-x-y PR was merged to the "33-x-y" branch. and removed in-flight/34-x-y in-flight/32-x-y in-flight/35-x-y in-flight/33-x-y labels Feb 20, 2025
@nikwen
Copy link
Member

nikwen commented Feb 21, 2025

This might have something to do with it working on so many machines: #44174

@nikwen
Copy link
Member

nikwen commented May 22, 2025

Follow up issue because this will happen in real apps, too: #47228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-flake ⭕️ Issues specific to CI flakes, not bugs, if a bug happens to be related to a CI flake merge them merged/32-x-y PR was merged to the "32-x-y" branch. merged/33-x-y PR was merged to the "33-x-y" branch. merged/34-x-y PR was merged to the "34-x-y" branch. merged/35-x-y PR was merged to the "35-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.