This is an archive of the discontinued LLVM Phabricator instance.

Fix flakyness in TestWatchpointMultipleThreads
ClosedPublic

Authored by labath on Mar 29 2016, 8:57 AM.

Details

Summary

the inferior in the test deliberately does not lock a mutex when accessing the watched variable.
The reason for that is unclear as, based on the logs, the original intention of the test was to
check whether watchpoints get propagated to newly created threads, which should work fine even
with a mutex. Furthermore, in the unlikely event (which I have still observed happening from time
to time) that two threads do manage the execute the "critical section" simultaneously, the test
will fail, as it is expecting the watchpoint "hit count" to be 1, but in this case it will be 2.

Given this, I have simply chose to lock the mutex always, so that we have more predictible
behavior. Watchpoints being hit simultaneously is still (and correctly!) tested by
TestConcurrentEvents.

Diff Detail

Repository
rL LLVM

Event Timeline

labath updated this revision to Diff 51929.Mar 29 2016, 8:57 AM
labath retitled this revision from to Fix flakyness in TestWatchpointMultipleThreads.
labath updated this object.
labath added reviewers: clayborg, jingham.
labath added a subscriber: lldb-commits.
clayborg accepted this revision.Mar 29 2016, 9:26 AM
clayborg edited edge metadata.
This revision is now accepted and ready to land.Mar 29 2016, 9:26 AM
This revision was automatically updated to reflect the committed changes.