Repository navigation
Commit eab435f
committed
fix(test): authRetryCallers waits by the clock — its turn count ran out on the Linux release gate
v1.3.0's release gate failed in authRetryCallers.test.js: "never happened: the
renewal", in the first inline-completion case that polls. The suite had passed
on every machine it had been run on, all of them Macs.
until() gave a condition 400 turns of the event loop to come true. Inline
completion waits out its debounce on a real timer, and a timer is at least a
millisecond even when the setting is 0. How many turns fit into that
millisecond is the machine's business:
macOS a 0 ms timer fires after ~70 turns; 400 turns take ~5 ms
Linux it fires after ~1,500 turns; 400 turns take ~0.3 ms
So on the runner the count ran out before the timer had fired, and the request
the case was waiting on had not been sent yet. Nothing is wrong with the code
under test. The three cases that poll across the debounce are the ones exposed;
which of them fails first varies from run to run.
until() now waits by the clock: up to two seconds, the patience within() already
has. A condition that never comes true still fails, with the same message.
settle() stays a count of turns, and says what that is good for: only what no
timer stands in the way of. Both places that use it are that.
Reproduced before fixing, without the runner: in a Linux container the tag
fails 3 runs of 3, and on a Mac with every timer made 15 ms slower it fails
with the runner's exact message. With the fix: 60 of 60 in the container, all
48 suites there three times over, and all 48 on a Mac with and without the
slowed timers. No other suite counts turns across a timer; the slowed-timer
run would have shown one.
Not run on the GitHub runner itself yet, and the container has Node 18 where
the runner has 24. The next commit makes the pull request do that run.1 parent 214e67d commit eab435f
1 file changed
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
213 | 222 | | |
214 | | - | |
215 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
216 | 228 | | |
217 | | - | |
| 229 | + | |
218 | 230 | | |
219 | 231 | | |
220 | 232 | | |
| |||
0 commit comments