Commit 07525f4
fix: wait for goroutine before TempDir cleanup in process test (#17)
TestProcessTopByCPU_SortRegression spawns a goroutine that writes to
TempDir after 1ms. On Go 1.25+ t.TempDir() cleanup is strict and fails
if the directory is not empty. The goroutine could still be writing
when cleanup starts.
Fix: t.Cleanup(func() { <-done }) ensures goroutine finishes before
TempDir removal.
Co-authored-by: dmitriimaksimovdevelop <227611064+dmitriimaksimovdevelop@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9800173 commit 07525f4
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
136 | 137 | | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| 142 | + | |
140 | 143 | | |
141 | 144 | | |
142 | 145 | | |
| |||
0 commit comments