test: fix TestCache_DeploymentStats flake#19683
Conversation
|
Can we stop using |
@spikecurtis I've gone with an approach similar to that used by If this approach looks good to you, I'll update the other tests to also no longer use EDIT: An unrelated test is failing because it calls |
|
In general, Also, Quartz mocks are not really designed for integration tests where you have a whole lot of things calling into the clock with different intervals. |
1c19d4f to
3093efd
Compare
spikecurtis
left a comment
There was a problem hiding this comment.
Suggestion inline about only triggering a single tick and using Advance rather than AdvanceNext, but I don't need to review again. Nice work.
🎉 |

Closes coder/internal#961
Likely the same deal as in #19599, the body of
require.Eventuallynow fires immediately, when it used to fire after 250ms (the interval). Presumably, the deployment stats become ready before the vs code session count gets incremented. This was never an issue with the 250ms delay, as this flake has only cropped up after the testify version bump.We'll fix the issue by making it possible to wait for a full metrics cache refresh, i.e. removing
require.Eventuallyin this test altogether.