Commit 0b453aa
committed
fix(test): swap update.Action to no-op to avoid spinner-goroutine race [release]
CI on Go 1.26 darwin/arm64 caught a data race in
TestRootBefore_UpdateSubcommandSuppressesNotice: runUpdate's
uikit.RunWithSpinner spawns a goroutine to run its callback, and
tea.Program's internal sync edge between Send(doneMsg) and the parent's
Run() return isn't visible to the race detector — so when the test
mocks selfupdateCheck/Update/Exec and cleanup restores them after
buildRoot().Run() returns, the detector flags the read/write pair.
The test only needs to verify that root's Before suppresses the notice
when args target `update`. Swap update.Action to a no-op stub on the
buildRoot result so Before still fires with the same Args().First() but
no spinner goroutine spawns. Drop the no-longer-needed mocks.
Verified locally with -count=5 -race.1 parent 8342249 commit 0b453aa
1 file changed
Lines changed: 15 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
| |||
152 | 161 | | |
153 | 162 | | |
154 | 163 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
168 | 169 | | |
169 | 170 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | 171 | | |
175 | 172 | | |
176 | | - | |
| 173 | + | |
177 | 174 | | |
178 | 175 | | |
179 | 176 | | |
| |||
0 commit comments