From 5b72b4ad4a8b16f72aa0cc881508d30f193036f6 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Thu, 19 Apr 2018 11:17:41 -0700 Subject: [PATCH] tools: run-tests: FlushAndPurgeOnCleanup --- tools/run-tests.bat | 12 ++++++++++++ tst/winfsp-tests/exec-test.c | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/run-tests.bat b/tools/run-tests.bat index 1c93e270..6b34da2a 100755 --- a/tools/run-tests.bat +++ b/tools/run-tests.bat @@ -31,6 +31,7 @@ cd R: >nul 2>nul || (echo === Unable to find drive R: >&2 & goto fail) set dfl_tests=^ winfsp-tests-x64 ^ winfsp-tests-x64-case-randomize ^ + winfsp-tests-x64-flushpurge ^ winfsp-tests-x64-mountpoint-drive ^ winfsp-tests-x64-mountpoint-dir ^ winfsp-tests-x64-no-traverse ^ @@ -48,6 +49,7 @@ set dfl_tests=^ fscrash-x64 ^ winfsp-tests-x86 ^ winfsp-tests-x86-case-randomize ^ + winfsp-tests-x86-flushpurge ^ winfsp-tests-x86-mountpoint-drive ^ winfsp-tests-x86-mountpoint-dir ^ winfsp-tests-x86-no-traverse ^ @@ -167,6 +169,11 @@ winfsp-tests-x64 --case-randomize if !ERRORLEVEL! neq 0 goto fail exit /b 0 +:winfsp-tests-x64-flushpurge +winfsp-tests-x64 --flush-and-purge-on-cleanup +if !ERRORLEVEL! neq 0 goto fail +exit /b 0 + :winfsp-tests-x64-mountpoint-drive winfsp-tests-x64 --mountpoint=X: --resilient if !ERRORLEVEL! neq 0 goto fail @@ -197,6 +204,11 @@ winfsp-tests-x86 --case-randomize if !ERRORLEVEL! neq 0 goto fail exit /b 0 +:winfsp-tests-x86-flushpurge +winfsp-tests-x86 --flush-and-purge-on-cleanup +if !ERRORLEVEL! neq 0 goto fail +exit /b 0 + :winfsp-tests-x86-mountpoint-drive winfsp-tests-x86 --mountpoint=X: --resilient if !ERRORLEVEL! neq 0 goto fail diff --git a/tst/winfsp-tests/exec-test.c b/tst/winfsp-tests/exec-test.c index bc26cb8a..9c21c3f9 100644 --- a/tst/winfsp-tests/exec-test.c +++ b/tst/winfsp-tests/exec-test.c @@ -304,12 +304,14 @@ static void exec_rename_dir_dotest(ULONG Flags, PWSTR Prefix, ULONG FileInfoTime ASSERT(CreateDirectoryW(Dir1Path, 0)); - ExecHelper(FilePath, 1000, &Process); + ExecHelper(FilePath, 2000, &Process); + + Sleep(1000); /* give time for file handles to be closed (FlushAndPurgeOnCleanup) */ ASSERT(MoveFileExW(Dir1Path, Dir2Path, MOVEFILE_REPLACE_EXISTING)); ASSERT(MoveFileExW(Dir2Path, Dir1Path, MOVEFILE_REPLACE_EXISTING)); - WaitHelper(Process, 1000); + WaitHelper(Process, 2000); ASSERT(DeleteFileW(FilePath));