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

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@375431 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteProcessInfo.py b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteProcessInfo.py
index 5a3ae92..70cc255 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteProcessInfo.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteProcessInfo.py
@@ -53,7 +53,7 @@
         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/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
index 1d3a63d..0944ba5 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
@@ -52,7 +52,7 @@
         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/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py b/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
index a3abe20..1b30718 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
@@ -639,7 +639,7 @@
         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 @@
                                                             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 @@
                 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 @@
         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/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py b/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py
index 18efbf9..664b600 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py
@@ -14,7 +14,7 @@
 
     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/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py b/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
index 670d770..ac611bc 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -32,8 +32,9 @@
     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"