1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00
pgbackrest/test
David Steele 5314dbffc7 Adjust Wait object to be more accurate when nested.
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.
2023-09-09 11:22:33 -04:00
..
certificate SFTP support for repository storage. 2023-05-13 19:16:16 +03:00
code-count Multi-stanza check command. 2023-08-07 17:03:09 +01:00
data
lib/pgBackRestTest Allow archive-get command to run when stanza is stopped. 2023-08-29 13:49:49 -04:00
src Adjust Wait object to be more accurate when nested. 2023-09-09 11:22:33 -04:00
.gitignore Move coverage results to test/result. 2020-03-14 15:29:42 -04:00
ci.pl Remove user-facing documentation references to --vm=none. 2023-05-23 10:58:51 +03:00
container.yaml New CI container build for PostgreSQL 16 rc1. 2023-08-31 20:22:01 -04:00
define.yaml Multi-stanza check command. 2023-08-07 17:03:09 +01:00
Dockerfile SFTP support for repository storage. 2023-05-13 19:16:16 +03:00
test.pl Remove double spaces from comments and documentation. 2023-05-02 12:57:12 +03:00
uncrustify.cfg Check for stray execute permissions in test.pl --code-format. 2023-02-01 12:57:04 +07:00
Vagrantfile SFTP support for repository storage. 2023-05-13 19:16:16 +03:00