The "ADC setup reads gcloud's complete consent URL ..." test's
writesThenFails fake started the ADC write on one 5ms timer (void, not
awaited) and exited on another 40ms timer. beginAdcLogin stats the ADC
file on a non-zero exit to tell "saved, then the quota probe failed"
from a failed consent, so when the write took more than ~35ms on a busy
machine the exit was read before the file existed and the test saw
"gcloud could not set up ADC". Real gcloud has written the file before
it exits, so the plugin is right and the race was the test's: the fake
now emits exit only once its write has resolved.
Run on mote (Bun 1.4.2, TMPDIR and HOME inside the run dir):
- reproduced: the write's timer moved 5ms -> 60ms on the old test: red
("gcloud could not set up ADC") every run.
- fixed, with a 100ms sleep injected into fixture.setAdc: green.
- broken by hand (the fake's exit no longer awaits the write), same
100ms injection: red. Injection removed afterwards.
- bun test packages/gcp-ai: 95 pass, 14 skip, 0 fail.
- bun scripts/check.mjs gcp-ai: ok.
- repo-root bun test: 6867 pass, 0 fail (499 files).
Only a test changed, so no version bump.
Fixes#835