1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-02-03 13:21:32 +02:00

Add wait for async archive log exists check in integration test.

They may be a small delay before the log exists, especially on slower platforms. Add a wait so the test does not fail in this case.
This commit is contained in:
David Steele 2024-11-15 09:44:15 -05:00
parent 12fe139315
commit 4ae160aa34
3 changed files with 4 additions and 2 deletions

View File

@ -111,7 +111,7 @@ testStorageExists(const Storage *const storage, const char *const file, const Te
printf("file exists '%s'", strZ(fileFull));
hrnTestResultComment(param.comment);
hrnTestResultBool(storageExistsP(storage, fileFull), true);
hrnTestResultBool(storageExistsP(storage, fileFull, .timeout = param.timeout), true);
if (param.remove)
storageRemoveP(storage, fileFull, .errorOnMissing = true);

View File

@ -46,6 +46,7 @@ typedef struct TestStorageExistsParam
VAR_PARAM_HEADER;
bool remove; // Remove file after testing?
const char *comment; // Comment
TimeMSec timeout; // Wait for file to exist
} TestStorageExistsParam;
#define TEST_STORAGE_EXISTS(storage, file, ...) \

View File

@ -223,7 +223,8 @@ testRun(void)
HRN_HOST_WAL_SWITCH(pg1);
TEST_STORAGE_EXISTS(
hrnHostDataStorage(pg1), zNewFmt("%s/" HRN_STANZA "-archive-push-async.log", strZ(hrnHostLogPath(pg1))));
hrnHostDataStorage(pg1), zNewFmt("%s/" HRN_STANZA "-archive-push-async.log", strZ(hrnHostLogPath(pg1))),
.timeout = 5000);
// -------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("setup time target");