fix: avoid global stream race in retry hook test · github/gh-ost@66059b7 · GitHub
Skip to content

Commit 66059b7

Browse files
authored
fix: avoid global stream race in retry hook test
The retry-hook test redirected os.Stdout and os.Stderr to capture status and hook output. Migrate has background status and logging goroutines, so reassigning those process-global streams races with their output. Inject a status writer into Migrator, retaining stdout as the default. The test supplies thread-safe buffers for the outputs, preserving the separate stdout and stderr assertions without mutating global state.
1 parent b8d0832 commit 66059b7

2 files changed

Lines changed: 27 additions & 18 deletions

File tree

‎go/logic/migrator.go‎

Lines changed: 3 additions & 1 deletion

‎go/logic/migrator_test.go‎

Lines changed: 24 additions & 17 deletions

0 commit comments

Comments
 (0)