Copilot, Factory and ZCode's device sign-ins wait at least a second
between polls, whatever interval the vendor gives. The tests' fakes give
0, so each poll in a test cost a full second, and these tests were 56.5s
of the provider package's 399s of test time.
The floor is now devicePollFloor, read through devicePoll(seconds) at the
three call sites, and the provider package's TestMain lowers it to 10ms.
Real sign-ins still wait max(vendor's interval, 1s), as before.
TestDevicePollKeepsItsFloor checks 0, -1 and 1 give 1s and 5 gives 5s.
Run:
- go test ./internal/provider (full, -count=1, load avg ~100): pass,
403s -> 316s of package time; the Copilot/Factory/ZCode tests 56.5s
-> 22.5s.
- A/B on -run 'Copilot|Factory|ZCode', base vs this: 45-58s vs 15-16s
(32s once, under load).
- Removing the floor from devicePoll turns TestDevicePollKeepsItsFloor red.
- gofmt -l clean; go vet darwin, linux (-tags nogui), windows; linux and
windows builds.
One A/B round failed on both base and this change at load over 200; the
cause wasn't captured, and the next 4 rounds passed on both.
Not done: the other slow causes in the package. The 1.2s sleeps waiting
for the callback port to be let go (signin_test.go:137,
signin_proxy_test.go:92, signin_usage_afresh_test.go:70), Cursor's
linkWait, MoveToPlugin (7-9s) and WarmAtSeveralTimes (6-10s).