Skip to content

Conversation

@KaiPrince
Copy link
Contributor

@KaiPrince KaiPrince commented Oct 27, 2025

I believe the cause of CI failing is that error messages are being overwritten by subsequent writes to stderr. This PR fixes the failing CI by concatenating the stderr buffer rather than replacing it.

Related Issue

Resolves #76

Summary of Changes

  1. Use += to buffer the stderr output

@KaiPrince KaiPrince marked this pull request as ready for review October 27, 2025 03:47
@KaiPrince KaiPrince changed the title empty commit fix: #76 accumulate stderr Oct 27, 2025
@KaiPrince KaiPrince mentioned this pull request Oct 27, 2025
4 tasks
@thescientist13
Copy link
Owner

thescientist13 commented Oct 29, 2025

Not sure if this is related to CI, but I have been noticing intermittent issues in Greenwood test cases that seem related to this

Where one of the new reject based test cases keeps failing on the error output
https://github.com/ProjectEvergreen/greenwood/blob/master/packages/cli/test/cases/build.plugins.error-name/build.plugins.error-name.spec.js#L49

1) Build Greenwood With: 
     Custom Configuration with a bad name value for a plugin
       should throw an error that plugin.name is not a string:

    AssertionError: expected promise to be rejected with an error including 'Configuration error: plugins must have a name. got undefined instead.' but got '\r\nNode.js v22.20.0\r\n'
    + expected - actual

    -
    -Node.js v22.20.0
    +Configuration error: plugins must have a name. got undefined instead.

I wonder if this will help?

@thescientist13
Copy link
Owner

thescientist13 commented Oct 29, 2025

Lol, literally the same thing just happened on my new PR here 🙃 - #78
https://github.com/thescientist13/gallinago/actions/runs/18894551028/job/53929173625?pr=78

  1) CLI Error Handling
       handling (and bubbling) an exception from the child process
         should throw an error that this is child throwing (a Promise.reject):

      AssertionError: expected promise to be rejected with an error including 'Error: Child process throwing a Promi…' but got '\r\nNode.js v24.10.0\r\n'
      + expected - actual

      -
      -Node.js v24.10.0
      +Error: Child process throwing a Promise.reject to the parent.

Copy link
Owner

@thescientist13 thescientist13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind writing up an issue for this to detail the specifics (to superceed #76 ), for the release notes? I will also test this out in Greenwood tomorrow too, but I think this may be something we need for sure. 👍

@thescientist13 thescientist13 added the bug Something isn't working label Oct 29, 2025

this.childProcess.stderr.on('data', (data) => {
err = data.toString('utf8');
err += data.toString("utf8"); // Max string size ~1GiB
Copy link
Owner

@thescientist13 thescientist13 Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious, would this be the same thing though as we had before? I'm wondering if we need to concact the entire output before doing console.error? Or maybe I'm just misunderstanding, but this does feel like there is a there there, so to speak. 🤔

@thescientist13
Copy link
Owner

Got a PR up in Greenwood with this change and nothing is breaking! :)

Will run it a couple more times but I think this one will be good to go once we clean up the title / details in the source issue.

Copy link
Owner

@thescientist13 thescientist13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I think I understand what is happening now. Thanks for this fix!

@thescientist13 thescientist13 merged commit ac6b821 into thescientist13:master Nov 5, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error message after process exits is overwritten by node version

2 participants