Closed marco-m-pix4d closed 1 year ago
@Pix4D/integration: ready for re-review. Given the refactoring, I suggest to review commit-per-commit; the commit message is there to help understanding the reason of each change.
Thanks @aliculPix4D for pointing out yet another corner case. It has been longer than expected, but I think now that we can trust the tests. I also think that the retry loop is now self-evident.
Using a virtual sleep reduced the test running time from 4.5 sec to circa 1.1 sec, although we went from 215 to 224 test cases :-)
As mentioned, this is approach 2 at fixing https://github.com/Pix4D/cogito/issues/132. See also approach 1 at #133.
Compared with #133, it keeps the tests running as fast as possible and does not introduce test flakiness since it does not measure time.
To do this, I added an injectable sleep function, which I then substituted with a spy in the tests.
Best reviewed commit-per-commit, since commit 1 adds the repro and commit 2 adds the fix.
Fixes https://github.com/Pix4D/cogito/issues/132.