This is an archive of the discontinued LLVM Phabricator instance.

Add file-based synchronization to flaky test
ClosedPublic

Authored by aprantl on Jan 2 2019, 10:51 AM.

Details

Summary

TestQueues is failing randomly on green dragon and I suspect it is because the enqueued threads haven't executed by the time we expect them.

Diff Detail

Repository
rL LLVM

Event Timeline

aprantl created this revision.Jan 2 2019, 10:51 AM
JDevlieghere accepted this revision.Jan 2 2019, 10:52 AM

Thanks Adrian, looks good.

This revision is now accepted and ready to land.Jan 2 2019, 10:52 AM
This revision was automatically updated to reflect the committed changes.
labath added a subscriber: labath.Jan 2 2019, 11:47 PM
labath added inline comments.
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
132

Will this actually help? It could be I'm missing something about how macos queues work, but it seems to me that at this point the process is already stopped, and so it has either managed to create the token files, or it hasn't. Waiting isn't going to make things better.

The way I'd synchronize these things is via barriers. I'd put one pseudo_barrier_wait in place of the touch calls, and then another just before the call to stopper. That way you guarantee that the queues have been initialized even before you hit the stopper breakpoint.

Note that using barriers will require porting this code to (obj)c++ (they use atomics), but that doesn't seem like it would alter the purpose of this test.

I implemented a poor man's version of that in r350360.