Commit a814579
go/mysql: stop TestStaticConfigHUP panicking inside EventuallyWithT
The previous deflake commit (e3cd779) ported the EventuallyWithT
callback verbatim from upstream's PR #19388, which uses `require.X(c,
...)`. That works on upstream's testify v1.11+, but this branch is
pinned to testify v1.9, where `CollectT.FailNow` is implemented as
`panic("Assertion failed")` and `EventuallyWithT` doesn't recover from
it — so the first failed poll crashes the goroutine. The job log
showed exactly that:
panic: Assertion failed
testify/assert.(*CollectT).FailNow ...
EventuallyWithT.func1 ...
FAIL vitess.io/vitess/go/mysql
Replace `require.X(c, ...)` with `assert.X(c, ...)` (which just flags
the CollectT instead of panicking) and guard the `entries[0]` indexing
on `assert.NotEmpty`, otherwise a `nil[0]` slice access escapes the
same way.
Hoisted the polling loop into a `waitForReload` helper since both
hupTest and hupTestWithRotation now use the same body.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Arthur Schreiber <arthur@planetscale.com>
(cherry picked from commit 248182c)1 parent 196e56e commit a814579
1 file changed
Lines changed: 21 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 163 | + | |
167 | 164 | | |
168 | 165 | | |
169 | 166 | | |
| |||
172 | 169 | | |
173 | 170 | | |
174 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
175 | 186 | | |
176 | | - | |
177 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
178 | 193 | | |
179 | 194 | | |
180 | 195 | | |
| |||
0 commit comments