Skip to content

Bizarre file ownerships causing failures on MacOS #25

@mirams

Description

@mirams

Simple test that illustrates it - TestFileFinder.hpp

Fails with messages like this:

 ***** TestFileFinder.hpp *****


Entering TestFileFinderOpening
Passed
Entering TestNewer
Passed
Entering TestIsAbsolutePath
Passed
Entering TestDirFinder
Passed
Entering TestHandyFilenameOperations
Passed
Entering TestFaking
Passed
Entering TestRemove
Passed
Entering TestFindMatches
Passed
Entering TestCopying

/home/chaste/src/global/test/TestFileFinder.hpp:361: Error: Test failed: filesystem error: status: Permission denied [/home/chaste/output/TestFileFinder_TestCopyingFolders/TestFileFinder_TestCopying/new_name]
Failed
Entering TestDefaultConstructor
Passed

Failed 1 of 10 tests

Looking at the file it mentions, the folder has some file chown settings no-one has ever seen before!

~/output/TestFileFinder_TestCopyingFolders/TestFileFinder_TestCopying$ ls -ltra
ls: cannot access 'new_name': Permission denied
ls: cannot access 'TestFileFinder.hpp': Permission denied
total 0
-????????? ? ?      ?        ?            ? new_name
-????????? ? ?      ?        ?            ? TestFileFinder.hpp
drwxr-xr-x 4 chaste chaste 128 Jan  9 13:37 sub1
--w------- 1 chaste chaste   0 Jan  9 13:37 .chaste_deletable_folder
drwxr-xr-x 6 chaste chaste 192 Jan  9 13:37 .
drwxr-xr-x 5 chaste chaste 160 Jan  9 13:37

Doing a bit of detective work, I think it is this line which causes it - a call to FileFinder::CopyTo, applied to a directory, only where the source and destination are both somewhere in the testoutput (the bound docker volume).

Under the hood, this only seems to be using std::filesystem::directory_iterator, std::filesystem::create_directory(dest) . Both these seem to work, as the created folders have the right permissions and the tree is constructed right. And then std::filesystem::copy_file on line 305 of FileFinder.cpp must be doing something weird.

Even then it is a bit intermittent, and when I've started with a clean ~/output folder sometimes it works first time, fails second, and sometimes it always fails!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions