File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ import (
1919)
2020
2121// captureStderr temporarily redirects os.Stderr and returns the written content.
22- // Not safe to call in parallel tests.
22+ // Must NOT be called from parallel tests (t.Parallel()) because it redirects
23+ // the global os.Stderr. Tests using this helper must run sequentially.
2324func captureStderr (f func ()) string {
2425 r , w , err := os .Pipe ()
2526 if err != nil {
@@ -36,7 +37,8 @@ func captureStderr(f func()) string {
3637}
3738
3839// captureStdout temporarily redirects os.Stdout and returns the written content.
39- // Not safe to call in parallel tests.
40+ // Must NOT be called from parallel tests (t.Parallel()) because it redirects
41+ // the global os.Stdout. Tests using this helper must run sequentially.
4042func captureStdout (f func ()) string {
4143 r , w , err := os .Pipe ()
4244 if err != nil {
You can’t perform that action at this time.
0 commit comments