Address flakyness in TestAttachResume
Summary: The test (among other things) attempts to verify that detaching works while the inferior is running. However, this was racy since the inferior could end up stopping again before we got a chance to detach from it (the test could be made to fail reliably by inserting a sleep just after the last "continue" command). The reason for the stop was that we had a breakpoint set in a place that can be hit by multiple threads, and we stop because another thread hit a breakpoint. I fix this by moving the breakpoint to a place that is reachable from only one thread. I also make sure that the same thread cannot hit the breakpoint if we are exceptionaly slow by flipping a flag which makes the breakpoint unreachable (I cannot just disable or delete the breakpoint as the test makes it a point to try detaching while breakpoints are still set). Another source or racyness was that the test verified that the process resumes and stops after a "continue". However, if these two events happened too fast, the initial start event would be lost, and the test would end up confused. I have implemented this in a safer manner and made a utility function out of it, as I know of a couple of other tests which need the same functionality. Reviewers: zturner, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12527 llvm-svn: 246623
Loading
Please sign in to comment