diff options
author | Pavel Labath <labath@google.com> | 2016-03-16 09:44:49 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-03-16 09:44:49 +0000 |
commit | 78fc4839808b432ac174b36204038bff63a986ef (patch) | |
tree | 3e53222e4122c52fcedab2476c265428870b643c /lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py | |
parent | 39aab4d60664a3ee56e7add57aafed453cab1df7 (diff) | |
download | bcm5719-llvm-78fc4839808b432ac174b36204038bff63a986ef.tar.gz bcm5719-llvm-78fc4839808b432ac174b36204038bff63a986ef.zip |
[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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py index c0ea841e2a0..18b570d4d82 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py @@ -154,6 +154,7 @@ def expect_lldb_gdbserver_replay( asserter, sock, test_sequence, + pump_queues, timeout_seconds, logger=None): """Replay socket communication with lldb-gdbserver and verify responses. @@ -193,7 +194,7 @@ def expect_lldb_gdbserver_replay( return {} context = {"O_count":0, "O_content":""} - with socket_packet_pump.SocketPacketPump(sock, logger) as pump: + with socket_packet_pump.SocketPacketPump(sock, pump_queues, logger) as pump: # Grab the first sequence entry. sequence_entry = test_sequence.entries.pop(0) @@ -220,14 +221,14 @@ def expect_lldb_gdbserver_replay( if sequence_entry.is_output_matcher(): try: # Grab next entry from the output queue. - content = pump.output_queue().get(True, timeout_seconds) + content = pump_queues.output_queue().get(True, timeout_seconds) except queue.Empty: if logger: logger.warning("timeout waiting for stub output (accumulated output:{})".format(pump.get_accumulated_output())) raise Exception("timed out while waiting for output match (accumulated output: {})".format(pump.get_accumulated_output())) else: try: - content = pump.packet_queue().get(True, timeout_seconds) + content = pump_queues.packet_queue().get(True, timeout_seconds) except queue.Empty: if logger: logger.warning("timeout waiting for packet match (receive buffer: {})".format(pump.get_receive_buffer())) |