mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2024-12-12 10:04:14 +02:00
5314dbffc7
The prior code gave a "free" extra iteration at the end of the wait, functionality that was copied directly from the equivalent code in Perl. This works and is mostly negligible except when wait loops are nested, in which case outer loops will always run twice even if an inner loop times out, which has a multiplying effect. For example, three nested wait loops with a timeout of three seconds will result in the inner loop being run four times (for a total of twelve seconds) even if it times out each time. Instead make waitMore() stop exactly when time is up. This makes more sense because a complete failure and timeout of an inner loop means retrying an outer loop is probably a waste of time since that inner loop will likely continue to fail. Also make waitRemaining() recalculate the remaining time rather than depending on the prior result. Some tests needed to be adjusted to take into account there being one less loop. In general this led to a simplification of the tests. Reinit a begin value in the wait unit tests. This is not related to the current change but it does make the time measurements more accurate and less likely to fail on an edge case, which has been observed from time to time. This change appears to have a benefit for test runtime, which seems plausible especially for nested waits, but a larger sample of CI runs are needed to be sure. |
||
---|---|---|
.. | ||
certificate | ||
code-count | ||
data | ||
lib/pgBackRestTest | ||
src | ||
.gitignore | ||
ci.pl | ||
container.yaml | ||
define.yaml | ||
Dockerfile | ||
test.pl | ||
uncrustify.cfg | ||
Vagrantfile |