Skip to content

Conversation

@trulede
Copy link
Contributor

@trulede trulede commented Aug 3, 2025

Writes to stdout from deps are occasionally "mixed up" because of stdout buffering. To prevent this, the entire grouped output is written with one call to gw.buffer.WriteString() rather than the previous two calls.

Additionally, to reduce flaky tests, use a SyncBuffer which prevents interleaving of stdout/err (typically from deps which run in parallel).

fixes #2349
fixes #1208

@trulede trulede changed the title Fix concurant writes to stdout from deps. Fix concurrent writes to stdout from deps. Aug 4, 2025
Copy link
Member

@pd93 pd93 left a comment

Choose a reason for hiding this comment

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

Nice! This has been bothering me for a while. Thanks for investigating.

@netlify
Copy link

netlify bot commented Aug 9, 2025

Deploy Preview for next-taskfile canceled.

Name Link
🔨 Latest commit 985e1ba
🔍 Latest deploy log https://app.netlify.com/projects/next-taskfile/deploys/68988a7fa0f6c000080715bb

@trulede trulede requested a review from andreynering August 9, 2025 21:35
@trulede trulede changed the title Fix concurrent writes to stdout from deps. Fix concurrent writes to stdout in tests. Aug 10, 2025
@andreynering andreynering merged commit 39c8699 into go-task:main Nov 11, 2025
13 checks passed
@andreynering
Copy link
Member

Thank you @trulede!

I pushed a follow-up commit to tidy up the code a bit, but your diagnose was correct!

andreynering added a commit that referenced this pull request Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Occasional flaky tests with grouped output. Grouped output is mixed with Task output

3 participants