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:
parent
12fe139315
commit
4ae160aa34
@ -111,7 +111,7 @@ testStorageExists(const Storage *const storage, const char *const file, const Te
|
|||||||
printf("file exists '%s'", strZ(fileFull));
|
printf("file exists '%s'", strZ(fileFull));
|
||||||
hrnTestResultComment(param.comment);
|
hrnTestResultComment(param.comment);
|
||||||
|
|
||||||
hrnTestResultBool(storageExistsP(storage, fileFull), true);
|
hrnTestResultBool(storageExistsP(storage, fileFull, .timeout = param.timeout), true);
|
||||||
|
|
||||||
if (param.remove)
|
if (param.remove)
|
||||||
storageRemoveP(storage, fileFull, .errorOnMissing = true);
|
storageRemoveP(storage, fileFull, .errorOnMissing = true);
|
||||||
|
@ -46,6 +46,7 @@ typedef struct TestStorageExistsParam
|
|||||||
VAR_PARAM_HEADER;
|
VAR_PARAM_HEADER;
|
||||||
bool remove; // Remove file after testing?
|
bool remove; // Remove file after testing?
|
||||||
const char *comment; // Comment
|
const char *comment; // Comment
|
||||||
|
TimeMSec timeout; // Wait for file to exist
|
||||||
} TestStorageExistsParam;
|
} TestStorageExistsParam;
|
||||||
|
|
||||||
#define TEST_STORAGE_EXISTS(storage, file, ...) \
|
#define TEST_STORAGE_EXISTS(storage, file, ...) \
|
||||||
|
@ -223,7 +223,8 @@ testRun(void)
|
|||||||
HRN_HOST_WAL_SWITCH(pg1);
|
HRN_HOST_WAL_SWITCH(pg1);
|
||||||
|
|
||||||
TEST_STORAGE_EXISTS(
|
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");
|
TEST_TITLE("setup time target");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user