From b7fd763369f8e10a1d0dcab85351572dea374ace Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Thu, 14 Oct 2010 15:58:53 +0000 Subject: [PATCH] Add more comments and wait a little bit after resuming the inferior process before sending it a signal. llvm-svn: 116481 --- lldb/test/signal/TestSendSignal.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lldb/test/signal/TestSendSignal.py b/lldb/test/signal/TestSendSignal.py index 8c188d3d98c8..3c6b8a7107f9 100644 --- a/lldb/test/signal/TestSendSignal.py +++ b/lldb/test/signal/TestSendSignal.py @@ -53,14 +53,23 @@ class SendSignalTestCase(TestBase): output = self.res.GetOutput() pid = re.match("Process (.*) Stopped", output).group(1) - # After resuming the process, immediately send a SIGUSR1 signal. + # After resuming the process, send it a SIGUSR1 signal. + + # It is necessary at this point to make command interpreter interaction + # be asynchronous, because we want to resume the process and to send it + # a signal. self.dbg.SetAsync(True) self.runCmd("process continue") + # Insert a delay of 1 second before doing the signaling stuffs. + time.sleep(1) + self.runCmd("process handle -n False -p True -s True SIGUSR1") #os.kill(int(pid), signal.SIGUSR1) self.runCmd("process signal SIGUSR1") + # Insert a delay of 1 second before checking the process status. time.sleep(1) + # Make the interaction mode be synchronous again. self.dbg.SetAsync(False) self.expect("process status", STOPPED_DUE_TO_SIGNAL, startstr = "Process %s Stopped" % pid,