summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/process
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-03-12 10:12:41 +0000
committerPavel Labath <labath@google.com>2015-03-12 10:12:41 +0000
commit3f5df53fdef2593662cca8d274566e761cb8a91d (patch)
tree4bcdab7f1e1013996c221845de4f680459faf490 /lldb/test/python_api/process
parent9425b329c8f72b3ea6b5fdb771e4a339afcd5e10 (diff)
downloadbcm5719-llvm-3f5df53fdef2593662cca8d274566e761cb8a91d.tar.gz
bcm5719-llvm-3f5df53fdef2593662cca8d274566e761cb8a91d.zip
Fix ProcessIO test failures
Summary: There was a race condition regarding the output of the inferior process. The reading of the output is performed on a separate thread, and there was no guarantee that the output will get eventually consumed. Because of that, it was happening that calling Process::GetSTDOUT was not returning anything even though the process was terminated and would definitely not produce any further output. This was usually happening only under very heavy system load, but it can be reproduced by placing an usleep in the stdio thread (Process::STDIOReadThreadBytesReceived). This patch addresses this by adding synchronization capabilities to the Communication thread. After calling Communication::SynchronizeWithReadThread one can be sure that all pending input has been processed by the read thread. This function is then called after every public event which stops the process to obtain the entire process output. Test Plan: TestProcessIO.py should now succeed every time instead of flaking in and out. Reviewers: clayborg, jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8246 llvm-svn: 232023
Diffstat (limited to 'lldb/test/python_api/process')
-rw-r--r--lldb/test/python_api/process/io/TestProcessIO.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/lldb/test/python_api/process/io/TestProcessIO.py b/lldb/test/python_api/process/io/TestProcessIO.py
index 2eb7c298a78..8181a94cfc2 100644
--- a/lldb/test/python_api/process/io/TestProcessIO.py
+++ b/lldb/test/python_api/process/io/TestProcessIO.py
@@ -21,7 +21,6 @@ class ProcessIOTestCase(TestBase):
@unittest2.skipIf(sys.platform.startswith("win32"), "stdio manipulation unsupported on Windows")
@python_api_test
@dwarf_test
- @expectedFailureLinux # this test fails 7/100 dosep runs
def test_stdin_by_api_with_dwarf(self):
"""Exercise SBProcess.PutSTDIN()."""
self.buildDwarf()
@@ -38,7 +37,6 @@ class ProcessIOTestCase(TestBase):
@unittest2.skipIf(sys.platform.startswith("win32"), "stdio manipulation unsupported on Windows")
@python_api_test
@dwarf_test
- @expectedFailureLinux # this test fails 4/100 dosep runs
def test_stdin_redirection_with_dwarf(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDIN without specifying STDOUT or STDERR."""
self.buildDwarf()
@@ -55,7 +53,6 @@ class ProcessIOTestCase(TestBase):
@unittest2.skipIf(sys.platform.startswith("win32"), "stdio manipulation unsupported on Windows")
@python_api_test
@dwarf_test
- @expectedFailureLinux # this test fails 2/100 dosep runs
def test_stdout_redirection_with_dwarf(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT without specifying STDIN or STDERR."""
self.buildDwarf()
@@ -72,7 +69,6 @@ class ProcessIOTestCase(TestBase):
@unittest2.skipIf(sys.platform.startswith("win32"), "stdio manipulation unsupported on Windows")
@python_api_test
@dwarf_test
- @expectedFailureLinux # this test fails 5/100 dosep runs
def test_stderr_redirection_with_dwarf(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDERR without specifying STDIN or STDOUT."""
self.buildDwarf()
OpenPOWER on IntegriCloud