Commit ed81f62
Fix data race in Linux compress maintainer tests
TestCompressMaintainOwner and TestCompressMaintainMode waited for the
background compression goroutine with a fixed sleep before reading
state it writes (the fakeFS owner map and the compressed file). The
sleep established no happens-before relationship, so the race detector
reported a data race on Linux, where these tests run.
Replace the sleep with l.Close(), which now flushes the pending
compression and joins the mill goroutine, synchronizing its writes
with the subsequent assertions. This also makes the tests
deterministic rather than relying on a timing window.
Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent bdc5dcc commit ed81f62
1 file changed
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
118 | | - | |
119 | | - | |
120 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| |||
0 commit comments