Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utilityTestMT: intermittent failure on Mac #49

Open
jdswinbank opened this issue Oct 16, 2012 · 4 comments
Open

utilityTestMT: intermittent failure on Mac #49

jdswinbank opened this issue Oct 16, 2012 · 4 comments
Assignees

Comments

@jdswinbank
Copy link
Contributor

Using OSX 10.8 with both:

i686-apple-darwin12-gcc-apple-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) (MacPorts apple-gcc42 5666.3_9)
Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)

I see intermittent failures of utilityTestMT. For example:

$ ./utility/test/utilityTestMT 
QFileSystemWatcher::removePaths: list is empty
...

OK (3)
$ ./utility/test/utilityTestMT 
QFileSystemWatcher::removePaths: list is empty
.F..

/Users/jds/Work/pelican/pelican/pelican/utility/test/src/WatchedFileTest.cpp:66: Assertion
Test name: pelican::WatchedFileTest::test_watch
equality assertion failed
- Expected: 1
- Actual  : 2

Failures !!!
Run: 3   Failure total: 1   Failures: 1   Errors: 0

It looks as though writing data to the file is sometimes sending the readyRead() signal once, and sometimes twice. I'm assuming (...speculating) that what's actually happening is that the write is somtimes getting split at the filesystem level, and that two writes are being generated and sending two signals.

Somewhat relatedly, the comments in utility/test/src/WatchedFileTest.cpp seem misleading. At lines 57-58, it looks as though the first test case should send the signal once, whereas lines 70-72 indicate it should be sent twice. However, the assertions at lines 65 and 79 both check that it has been sent only once.

@ghost ghost assigned bmort Oct 16, 2012
@bmort
Copy link
Collaborator

bmort commented Oct 16, 2012

Thanks for the report, I see this failure happening quite a lot on my Mac too. I'll see if I find a fix for this problem later today - I'm not too familiar with this part of the code so will have to checking first to make sure any fix keeps (and checks) the correct behaviour.

@bmort
Copy link
Collaborator

bmort commented Oct 16, 2012

Yup, looks like this might be an OS specific issue with the implementation of QFileSystemWatcher. see: http://www.mail-archive.com/interest@qt-project.org/msg03016.html.

For now, I've added an additional unit test which reproduces the behaviour with QFileSystemWatcher in isolation and added a preprocessor macro guard around the CppUnit assert macros for OS X.

Clearly this has no impact at all on the behaviour of this class for any places it may be used outside the unit test so i'm leaving the issue open for now until I can do a bit more testing. The unit test should at least now pass 100% of the time.

@bmort
Copy link
Collaborator

bmort commented Oct 16, 2012

Any unresolved problems from this issue should be limited to the use of FileChunkers. While the unit tests on this object don't fail with the combinations of OS and compilers I've tried so far, I'm going to look into the test coverage on this object to make sure all use cases are being checked correctly.

@jdswinbank
Copy link
Contributor Author

Confirm that all the tests in the current head now pass on my laptop. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants