[Lldb-commits] [lldb] 1046b72 - [lldb] Account for extra threads in TestGdbRemoteThreadsInStopReply on windows

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 9 08:43:17 PST 2022


Author: Pavel Labath
Date: 2022-02-09T17:42:54+01:00
New Revision: 1046b726ad4461d0ba0a8c9391836b679a719a60

URL: https://github.com/llvm/llvm-project/commit/1046b726ad4461d0ba0a8c9391836b679a719a60
DIFF: https://github.com/llvm/llvm-project/commit/1046b726ad4461d0ba0a8c9391836b679a719a60.diff

LOG: [lldb] Account for extra threads in TestGdbRemoteThreadsInStopReply on windows

After 9611282c, TestGdbRemoteThreadsInStopReply is not non-deterministic
-- instead it deterministically fails due to extra threads created by
std::thread thread pool.

Adjust the tests to account for that.

Added: 
    

Modified: 
    lldb/test/API/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py b/lldb/test/API/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
index fafaf953be52..11ebba827515 100644
--- a/lldb/test/API/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
+++ b/lldb/test/API/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
@@ -126,6 +126,7 @@ def test_QListThreadsInStopReply_supported(self):
         self.assertIsNotNone(context)
 
     @skipIfNetBSD
+    @expectedFailureAll(oslist=["windows"]) # Extra threads present
     def test_stop_reply_reports_multiple_threads(self):
         self.build()
         self.set_inferior_startup_launch()
@@ -165,7 +166,7 @@ def test_stop_reply_reports_correct_threads(self):
 
         threads = self.parse_threadinfo_packets(context)
         self.assertIsNotNone(threads)
-        self.assertEqual(len(threads), thread_count)
+        self.assertGreaterEqual(len(threads), thread_count)
 
         # Ensure each thread in q{f,s}ThreadInfo appears in stop reply threads
         for tid in threads:
@@ -182,12 +183,12 @@ def test_stop_reply_contains_thread_pcs(self):
         stop_reply_pcs = results["thread_pcs"]
         pc_register = results["pc_register"]
         little_endian = results["little_endian"]
-        self.assertEqual(len(stop_reply_pcs), thread_count)
+        self.assertGreaterEqual(len(stop_reply_pcs), thread_count)
 
         threads_info_pcs = self.gather_threads_info_pcs(pc_register,
                 little_endian)
 
-        self.assertEqual(len(threads_info_pcs), thread_count)
+        self.assertEqual(len(threads_info_pcs), len(stop_reply_pcs))
         for thread_id in stop_reply_pcs:
             self.assertIn(thread_id, threads_info_pcs)
             self.assertEqual(int(stop_reply_pcs[thread_id], 16),


        


More information about the lldb-commits mailing list