From 78fc4839808b432ac174b36204038bff63a986ef Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 16 Mar 2016 09:44:49 +0000 Subject: [test] Persist packets between expect_gdbremote_sequence invocations Summary: Some tests (Hc_then_Csignal_signals_correct_thread, at least) were sending a "continue" packet in one expect_gdbremote_sequence invocation, and "expecting" the stop-reply in another call. This posed a problem, because the were packets were not persisted between the two invocations, and if the stub was exceptionally fast to respond, the packet would be received in the first invocation (where it would be ignored) and then the second invocation would fail because it could not find the packet. Since doing matching in two invocations seems like a reasonable use of the packet pump, instead of fixing the test, I make sure the packet_pump supports this usage by making the list of captured packets persistent. Reviewers: tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18140 llvm-svn: 263629 --- .../Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py') diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py index 5c54eb53090..49323cd4078 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py @@ -78,6 +78,7 @@ class GdbRemoteTestCaseBase(TestBase): self.setUpBaseLogging() self._remote_server_log_file = None self.debug_monitor_extra_args = [] + self._pump_queues = socket_packet_pump.PumpQueues() if self.isVerboseLoggingRequested(): # If requested, full logs go to a log file @@ -109,6 +110,8 @@ class GdbRemoteTestCaseBase(TestBase): self.stub_hostname = "localhost" def tearDown(self): + self._pump_queues.verify_queues_empty() + if self._remote_server_log_file is not None: lldb.remote_platform.Get(lldb.SBFileSpec(self._remote_server_log_file), lldb.SBFileSpec(self.getLocalServerLogFile())) @@ -629,7 +632,8 @@ class GdbRemoteTestCaseBase(TestBase): def expect_gdbremote_sequence(self, timeout_seconds=None): if not timeout_seconds: timeout_seconds = self._TIMEOUT_SECONDS - return expect_lldb_gdbserver_replay(self, self.sock, self.test_sequence, timeout_seconds, self.logger) + return expect_lldb_gdbserver_replay(self, self.sock, self.test_sequence, + self._pump_queues, timeout_seconds, self.logger) _KNOWN_REGINFO_KEYS = [ "name", -- cgit v1.2.3