[Lldb-commits] [lldb] 5827a82 - Unify timeouts in gdbserver tests and ensure they are larger if ASAN is enabled.

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 21 10:18:25 PDT 2019


Author: Adrian Prantl
Date: 2019-10-21T17:19:42Z
New Revision: 5827a82a5870fcb59a9fb34e6891ca0f009d282a

URL: https://github.com/llvm/llvm-project/commit/5827a82a5870fcb59a9fb34e6891ca0f009d282a
DIFF: https://github.com/llvm/llvm-project/commit/5827a82a5870fcb59a9fb34e6891ca0f009d282a.diff

LOG: Unify timeouts in gdbserver tests and ensure they are larger if ASAN is enabled.

llvm-svn: 375431

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteProcessInfo.py
    lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
    lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
    lldb/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py
    lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteProcessInfo.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteProcessInfo.py
index 5a3ae926896a..70cc25520608 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteProcessInfo.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteProcessInfo.py
@@ -53,7 +53,7 @@ def attach_commandline_qProcessInfo_reports_correct_pid(self):
         self.add_process_info_collection_packets()
 
         # Run the stream
-        context = self.expect_gdbremote_sequence(timeout_seconds=8)
+        context = self.expect_gdbremote_sequence(timeout_seconds=self._DEFAULT_TIMEOUT)
         self.assertIsNotNone(context)
 
         # Gather process info response

diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
index 1d3a63d27b76..0944ba5d0510 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
@@ -52,7 +52,7 @@ def gather_stop_replies_via_qThreadStopInfo(self, thread_count):
         self.assertIsNotNone(context)
 
         # Wait until all threads have started.
-        threads = self.wait_for_thread_count(thread_count, timeout_seconds=3)
+        threads = self.wait_for_thread_count(thread_count, timeout_seconds=self._WAIT_TIMEOUT)
         self.assertIsNotNone(threads)
 
         # On Windows, there could be more threads spawned. For example, DebugBreakProcess will

diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
index a3abe203a987..1b30718f7481 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
@@ -639,7 +639,7 @@ def Hg_switches_to_3_threads(self):
         self.run_process_then_stop(run_seconds=1)
 
         # Wait at most x seconds for 3 threads to be present.
-        threads = self.wait_for_thread_count(3, timeout_seconds=5)
+        threads = self.wait_for_thread_count(3, timeout_seconds=self._WAIT_TIMEOUT)
         self.assertEqual(len(threads), 3)
 
         # verify we can $H to each thead, and $qC matches the thread we set.
@@ -735,7 +735,7 @@ def Hc_then_Csignal_signals_correct_thread(self, segfault_signo):
                                                             2: "thread_id"}}],
                                              True)
 
-            context = self.expect_gdbremote_sequence(timeout_seconds=10)
+            context = self.expect_gdbremote_sequence(timeout_seconds=self._DEFAULT_TIMEOUT)
             self.assertIsNotNone(context)
             signo = context.get("signo")
             self.assertEqual(int(signo, 16), segfault_signo)
@@ -771,7 +771,8 @@ def Hc_then_Csignal_signals_correct_thread(self, segfault_signo):
                 True)
 
             # Run the sequence.
-            context = self.expect_gdbremote_sequence(timeout_seconds=10)
+            context = self.expect_gdbremote_sequence(
+                timeout_seconds=self._DEFAULT_TIMEOUT)
             self.assertIsNotNone(context)
 
             # Ensure the stop signal is the signal we delivered.
@@ -1485,7 +1486,7 @@ def P_and_p_thread_suffix_work(self):
         self.assertIsNotNone(context)
 
         # Wait for 3 threads to be present.
-        threads = self.wait_for_thread_count(3, timeout_seconds=5)
+        threads = self.wait_for_thread_count(3, timeout_seconds=self._WAIT_TIMEOUT)
         self.assertEqual(len(threads), 3)
 
         expected_reg_values = []

diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py
index 18efbf9d650f..664b6001d8da 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py
@@ -14,7 +14,7 @@ class TestStubReverseConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
 
     mydir = TestBase.compute_mydir(__file__)
 
-    _DEFAULT_TIMEOUT = 20
+    _DEFAULT_TIMEOUT = 20 * (10 if ('ASAN_OPTIONS' in os.environ) else 1)
 
     def setUp(self):
         # Set up the test.

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 670d770f8819..ac611bcca169 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
@@ -32,8 +32,9 @@ class GdbRemoteTestCaseBase(TestBase):
     NO_DEBUG_INFO_TESTCASE = True
 
     _TIMEOUT_SECONDS = 120 * (10 if ('ASAN_OPTIONS' in os.environ) else 1)
+    _DEFAULT_TIMEOUT =  10 * (10 if ('ASAN_OPTIONS' in os.environ) else 1)
     _READ_TIMEOUT    =   5 * (10 if ('ASAN_OPTIONS' in os.environ) else 1)
-    _WAIT_TIMEOUT    =   3 * (10 if ('ASAN_OPTIONS' in os.environ) else 1)
+    _WAIT_TIMEOUT    =   5 * (10 if ('ASAN_OPTIONS' in os.environ) else 1)
 
     _GDBREMOTE_KILL_PACKET = "$k#6b"
 


        


More information about the lldb-commits mailing list