[Lldb-commits] [lldb] 10c309a - Removing test...
Jim Ingham via lldb-commits
lldb-commits at lists.llvm.org
Tue May 11 18:27:47 PDT 2021
Author: Jim Ingham
Date: 2021-05-11T18:27:37-07:00
New Revision: 10c309ad81e2be156ab44a83ee56cddea20637cc
URL: https://github.com/llvm/llvm-project/commit/10c309ad81e2be156ab44a83ee56cddea20637cc
DIFF: https://github.com/llvm/llvm-project/commit/10c309ad81e2be156ab44a83ee56cddea20637cc.diff
LOG: Removing test...
Actually, I don't think this test is going to be stable enough
to be worthwhile. Let me see if I can think of a better way to
test this.
Added:
Modified:
Removed:
lldb/test/API/functionalities/gdb_remote_client/TestHaltFails.py
################################################################################
diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestHaltFails.py b/lldb/test/API/functionalities/gdb_remote_client/TestHaltFails.py
deleted file mode 100644
index 3ee28b0757f9..000000000000
--- a/lldb/test/API/functionalities/gdb_remote_client/TestHaltFails.py
+++ /dev/null
@@ -1,93 +0,0 @@
-from __future__ import print_function
-import lldb
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test.decorators import *
-from gdbclientutils import *
-
-
-class TestHaltFails(GDBRemoteTestBase):
-
- class MyResponder(MockGDBServerResponder):
- def __init__(self, timeout):
- MockGDBServerResponder.__init__(self)
- self.timeout = timeout
-
- def setBreakpoint(self, packet):
- return "OK"
-
- def interrupt(self):
- # Simulate process waiting longer than the interrupt
- # timeout to stop, then sending the reply.
- time.sleep(self.timeout)
- return "T02reason:signal"
-
- def cont(self):
- # No response, wait for the client to interrupt us.
- return None
-
- def wait_for_and_check_event(self, wait_time, value):
- event = lldb.SBEvent()
- got_event = self.dbg.GetListener().WaitForEvent(wait_time, event)
- self.assertTrue(got_event, "Failed to get event after wait")
- self.assertTrue(lldb.SBProcess.EventIsProcessEvent(event), "Event was not a process event")
- event_type = lldb.SBProcess.GetStateFromEvent(event)
- self.assertEqual(event_type, value)
-
- def get_to_running(self, sleep_interval, interrupt_timeout = 5):
- self.server.responder = self.MyResponder(sleep_interval)
- self.target = self.createTarget("a.yaml")
- # Set a shorter (and known) interrupt timeout:
- self.dbg.HandleCommand("settings set target.process.interrupt-timeout {0}".format(interrupt_timeout))
- process = self.connect(self.target)
- self.dbg.SetAsync(True)
-
- # There should be a stopped event, consume that:
- self.wait_for_and_check_event(2, lldb.eStateStopped)
- process.Continue()
-
- # There should be a running event, consume that:
- self.wait_for_and_check_event(2, lldb.eStateRunning)
- return process
-
- @skipIfLinux # Failing on Linux, disabling to investigate
- @skipIfReproducer # FIXME: Unexpected packet during (passive) replay
- def test_destroy_while_running(self):
- process = self.get_to_running(10)
- process.Destroy()
-
- # Again pretend that after failing to be interrupted, we delivered the stop
- # and make sure we still exit properly.
- self.wait_for_and_check_event(14, lldb.eStateExited)
-
- @skipIfLinux # Failing on Linux, disabling to investigate
- @skipIfReproducer # FIXME: Unexpected packet during (passive) replay
- def test_async_interrupt(self):
- """
- Test that explicitly calling AsyncInterrupt, which then fails, leads
- to an "eStateExited" state.
- """
- process = self.get_to_running(10)
- # Now do the interrupt:
- process.SendAsyncInterrupt()
-
- # That should have caused the Halt to time out and we should
- # be in eStateExited:
- self.wait_for_and_check_event(15, lldb.eStateExited)
-
- @skipIfLinux # Failing on Linux, disabling to investigate
- @skipIfReproducer # FIXME: Unexpected packet during (passive) replay
- def test_interrupt_timeout(self):
- """
- Test that explicitly calling AsyncInterrupt but this time with
- an interrupt timeout longer than we're going to wait succeeds.
- """
- process = self.get_to_running(10, 20)
- # Now do the interrupt:
- process.SendAsyncInterrupt()
-
- # That should have caused the Halt to time out and we should
- # be in eStateExited:
- self.wait_for_and_check_event(20, lldb.eStateStopped)
-
-
-
More information about the lldb-commits
mailing list