Current Behavior
https://github.com/nrwl/nx/blob/master/packages/nx/src/command-line/affected/affected.ts#L90-L100
When running nx affected, the stdout is not drained before calling process.exit(). When a large output is currently buffered, like a large task output, it might not be sent to stdout and get cut off. This buffering can happen due to task grouping in Github Actions.
An example of this we are experiencing is a large e2e test report that is buffered and fails, but it not fully printed to the GH Actions log.
Expected Behavior
The output is drained to stdout before exiting.
Adding await output.drain(); before the process.exit() solves the issue.
GitHub Repo
https://github.com/Jamie4224/nx-output-bug-report
Steps to Reproduce
- Open the reproduction
- Run
pnpm run reproduce, you will see "finished writing x's"
- Run
./reproduce, you won't see "finished writing x's"
Nx Report
NX Report complete - copy this into the issue template
Node : 24.18.0
OS : darwin-arm64
Native Target : aarch64-macos
pnpm : 11.15.1
daemon : Available
nx : 23.1.0
@nx/js : 23.1.0
@nx/eslint : 23.1.0
@nx/workspace : 23.1.0
@nx/devkit : 23.1.0
@nx/vite : 23.1.0
@nx/vitest : 23.1.0
typescript : 5.9.3
Nx key
---------------------------------------
getNxKeyInformationAsync is not a function
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
---------------------------------------
Community plugins:
@nx/gcs-cache : 5.0.0
---------------------------------------
Cache Usage: 61.03 MB / 92.64 GB
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
Related:
Current Behavior
https://github.com/nrwl/nx/blob/master/packages/nx/src/command-line/affected/affected.ts#L90-L100
When running
nx affected, the stdout is not drained before calling process.exit(). When a large output is currently buffered, like a large task output, it might not be sent to stdout and get cut off. This buffering can happen due to task grouping in Github Actions.An example of this we are experiencing is a large e2e test report that is buffered and fails, but it not fully printed to the GH Actions log.
Expected Behavior
The output is drained to stdout before exiting.
Adding
await output.drain();before theprocess.exit()solves the issue.GitHub Repo
https://github.com/Jamie4224/nx-output-bug-report
Steps to Reproduce
pnpm run reproduce, you will see "finished writing x's"./reproduce, you won't see "finished writing x's"Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
Related: