Work around timing bug in OS X test cases

This commit is contained in:
Sebastian Messmer 2016-02-14 01:18:19 +01:00
parent 33c950e978
commit fcf817fbdd
2 changed files with 7 additions and 3 deletions

View File

@ -777,18 +777,18 @@ int Fuse::fsyncdir(const bf::path &path, int datasync, fuse_file_info *fileinfo)
void Fuse::init(fuse_conn_info *conn) {
UNUSED(conn);
LOG(INFO) << "Filesystem started.";
_running = true;
#ifdef FSPP_LOG
cpputils::logging::setLevel(DEBUG);
#endif
LOG(INFO) << "Filesystem started.";
}
void Fuse::destroy() {
_running = false;
LOG(INFO) << "Filesystem stopped.";
_running = false;
}
int Fuse::access(const bf::path &path, int mask) {

View File

@ -22,6 +22,10 @@ void FuseThread::start(int argc, char *argv[]) {
});
//Wait until it is running (busy waiting is simple and doesn't hurt much here)
while(!_fuse->running()) {}
#ifdef __APPLE__
// On Mac OS X, _fuse->running() returns true too early, because osxfuse calls init() when it's not ready yet. Give it a bit time.
std::this_thread::sleep_for(std::chrono::milliseconds(200));
#endif
}
void FuseThread::stop() {