Add some comments on failing Windows tests Some of the failing tests are related to the well-known file deletion problem. But there are also two strange failures when renaming a dir to itself and after an invalid hard link operation.
On my Windows 7 machine, any of these failures happens about once every 10-30 test runs. I also got a single segfault in TestFSFolder once after about 200 runs. Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/66126d7d Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/66126d7d Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/66126d7d Branch: refs/heads/master Commit: 66126d7d749dfd07a99f8a2a4f07d1f8d11e4688 Parents: 4342848 Author: Nick Wellnhofer <[email protected]> Authored: Sun Jul 12 13:18:49 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Sun Jul 12 13:18:49 2015 +0200 ---------------------------------------------------------------------- core/Lucy/Test/Store/TestFSFolder.c | 8 ++++++-- core/Lucy/Test/Store/TestFolderCommon.c | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/66126d7d/core/Lucy/Test/Store/TestFSFolder.c ---------------------------------------------------------------------- diff --git a/core/Lucy/Test/Store/TestFSFolder.c b/core/Lucy/Test/Store/TestFSFolder.c index aba0acc..23ee684 100644 --- a/core/Lucy/Test/Store/TestFSFolder.c +++ b/core/Lucy/Test/Store/TestFSFolder.c @@ -71,8 +71,12 @@ S_set_up() { static void S_tear_down() { struct stat stat_buf; - rmdir("_fstest"); - /* FIXME: This can fail on Windows. */ + int result = rmdir("_fstest"); + if (result < 0) { + /* FIXME: This can fail on Windows with ENOTEMPTY. */ + THROW(ERR, "Can't clean up directory _fstest: %s", strerror(errno)); + } + /* FIXME: This can also fail on Windows even if rmdir was successful. */ if (stat("_fstest", &stat_buf) != -1) { THROW(ERR, "Can't clean up directory _fstest"); } http://git-wip-us.apache.org/repos/asf/lucy/blob/66126d7d/core/Lucy/Test/Store/TestFolderCommon.c ---------------------------------------------------------------------- diff --git a/core/Lucy/Test/Store/TestFolderCommon.c b/core/Lucy/Test/Store/TestFolderCommon.c index d5f3a9d..07a9850 100644 --- a/core/Lucy/Test/Store/TestFolderCommon.c +++ b/core/Lucy/Test/Store/TestFolderCommon.c @@ -279,6 +279,7 @@ test_Local_Delete(TestBatchRunner *runner, set_up_t set_up, tear_down_t tear_dow Folder_Delete(folder, foo_boffo); TEST_TRUE(runner, Folder_Local_Delete(folder, foo), "Local_Delete on empty dir succeeds"); + // FIXME: This test sometimes fails on Windows. TEST_FALSE(runner, Folder_Exists(folder, foo), "Dir is really gone"); @@ -395,6 +396,7 @@ test_Rename(TestBatchRunner *runner, set_up_t set_up, tear_down_t tear_down) { "File still exists"); result = Folder_Rename(folder, foo_bar, foo_bar); + // FIXME: This test sometimes fails on Windows with "Permission denied". TEST_TRUE(runner, result, "Renaming dir to itself succeeds"); TEST_TRUE(runner, Folder_Exists(folder, foo_bar), "Dir still exists"); @@ -488,6 +490,7 @@ test_Hard_Link(TestBatchRunner *runner, set_up_t set_up, tear_down_t tear_down) TEST_FALSE(runner, result, "Hard_Link dir fails"); TEST_FALSE(runner, Folder_Exists(folder, banana), "Nothing at new path"); + // FIXME: This test sometimes fails on Windows. TEST_TRUE(runner, Folder_Exists(folder, baz), "Folder still exists at old path"); Folder_Delete(folder, baz);
