[Lldb-commits] [lldb] 667be33 - [lldb/Reproducers] Update macosx remote tests for passive replay

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed May 20 09:03:25 PDT 2020


Author: Jonas Devlieghere
Date: 2020-05-20T09:03:16-07:00
New Revision: 667be3319d9eff4fbcf1cb1714a1205e84c9b848

URL: https://github.com/llvm/llvm-project/commit/667be3319d9eff4fbcf1cb1714a1205e84c9b848
DIFF: https://github.com/llvm/llvm-project/commit/667be3319d9eff4fbcf1cb1714a1205e84c9b848.diff

LOG: [lldb/Reproducers] Update macosx remote tests for passive replay

Skip tests or part thereof that are not supposed to work with replay.

Added: 
    

Modified: 
    lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py
    lldb/test/API/macosx/function-starts/TestFunctionStarts.py
    lldb/test/API/macosx/profile_vrs_detach/TestDetachVrsProfile.py
    lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py b/lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py
index 6b7f12ede35f..d4073a9ed02d 100644
--- a/lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py
+++ b/lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py
@@ -15,7 +15,7 @@ class DyldTrieSymbolsTestCase(TestBase):
 
     @skipIfRemote
     @skipUnlessDarwin
-    
+
     def test_dyld_trie_symbols(self):
         """Test that we make create symbol table entries from the dyld trie data structure."""
         self.build()
@@ -89,20 +89,24 @@ def test_dyld_trie_symbols(self):
         # stripped off the objc prefix from the symbol names.
         syms_ctx = stripped_target.FindSymbols("SourceBase")
         self.assertEqual(syms_ctx.GetSize(), 2)
-        sym1 = syms_ctx.GetContextAtIndex(0).GetSymbol()
-        sym2 = syms_ctx.GetContextAtIndex(1).GetSymbol()
-
-        # one of these should be a lldb.eSymbolTypeObjCClass, the other
-        # should be lldb.eSymbolTypeObjCMetaClass.
-        if sym1.GetType() == lldb.eSymbolTypeObjCMetaClass:
-            self.assertEqual(sym2.GetType(), lldb.eSymbolTypeObjCClass)
-        else:
-            if sym1.GetType() == lldb.eSymbolTypeObjCClass:
-                self.assertEqual(sym2.GetType(), lldb.eSymbolTypeObjCMetaClass)
-            else:
-                self.assertTrue(sym1.GetType() == lldb.eSymbolTypeObjCMetaClass or sym1.GetType() == lldb.eSymbolTypeObjCClass)
 
-        syms_ctx = stripped_target.FindSymbols("SourceDerived._derivedValue")
-        self.assertEqual(syms_ctx.GetSize(), 1)
-        sym = syms_ctx.GetContextAtIndex(0).GetSymbol()
-        self.assertEqual(sym.GetType(), lldb.eSymbolTypeObjCIVar)
+        # The next part if not deterministic and potentially causes replay to
+        # fail when the order is 
diff erent during capture and replay.
+        if not configuration.is_reproducer():
+            sym1 = syms_ctx.GetContextAtIndex(0).GetSymbol()
+            sym2 = syms_ctx.GetContextAtIndex(1).GetSymbol()
+
+            # one of these should be a lldb.eSymbolTypeObjCClass, the other
+            # should be lldb.eSymbolTypeObjCMetaClass.
+            if sym1.GetType() == lldb.eSymbolTypeObjCMetaClass:
+                self.assertEqual(sym2.GetType(), lldb.eSymbolTypeObjCClass)
+            else:
+                if sym1.GetType() == lldb.eSymbolTypeObjCClass:
+                    self.assertEqual(sym2.GetType(), lldb.eSymbolTypeObjCMetaClass)
+                else:
+                    self.assertTrue(sym1.GetType() == lldb.eSymbolTypeObjCMetaClass or sym1.GetType() == lldb.eSymbolTypeObjCClass)
+
+            syms_ctx = stripped_target.FindSymbols("SourceDerived._derivedValue")
+            self.assertEqual(syms_ctx.GetSize(), 1)
+            sym = syms_ctx.GetContextAtIndex(0).GetSymbol()
+            self.assertEqual(sym.GetType(), lldb.eSymbolTypeObjCIVar)

diff  --git a/lldb/test/API/macosx/function-starts/TestFunctionStarts.py b/lldb/test/API/macosx/function-starts/TestFunctionStarts.py
index e876cdf8b5da..141f4e70930a 100644
--- a/lldb/test/API/macosx/function-starts/TestFunctionStarts.py
+++ b/lldb/test/API/macosx/function-starts/TestFunctionStarts.py
@@ -19,6 +19,7 @@ class FunctionStartsTestCase(TestBase):
 
     @skipIfRemote
     @skipUnlessDarwin
+    @skipIfReproducer # File synchronization is not supported during replay.
     def test_function_starts_binary(self):
         """Test that we make synthetic symbols when we have the binary."""
         self.build()
@@ -26,13 +27,14 @@ def test_function_starts_binary(self):
 
     @skipIfRemote
     @skipUnlessDarwin
+    @skipIfReproducer # File synchronization is not supported during replay.
     def test_function_starts_no_binary(self):
         """Test that we make synthetic symbols when we don't have the binary"""
         self.build()
         self.do_function_starts(True)
 
     def do_function_starts(self, in_memory):
-        """Run the binary, stop at our unstripped function, 
+        """Run the binary, stop at our unstripped function,
            make sure the caller has synthetic symbols"""
 
         exe = self.getBuildArtifact(exe_name)
@@ -57,7 +59,7 @@ def do_function_starts(self, in_memory):
         pid = lldbutil.wait_for_file_on_target(self, pid_file_path)
 
         if in_memory:
-          remove_file(exe)            
+          remove_file(exe)
 
         target = self.dbg.CreateTarget(None)
         self.assertTrue(target.IsValid(), "Got a vaid empty target.")
@@ -67,10 +69,10 @@ def do_function_starts(self, in_memory):
         attach_info.SetIgnoreExisting(False)
         process = target.Attach(attach_info, error)
         self.assertTrue(error.Success(), "Didn't attach successfully to %d: %s"%(popen.pid, error.GetCString()))
-        
+
         bkpt = target.BreakpointCreateByName("dont_strip_me", exe)
         self.assertTrue(bkpt.GetNumLocations() > 0, "Didn't set the dont_strip_me bkpt.")
-        
+
         threads = lldbutil.continue_to_breakpoint(process, bkpt)
         self.assertEqual(len(threads), 1, "Didn't hit my breakpoint.")
 
@@ -81,6 +83,6 @@ def do_function_starts(self, in_memory):
         name = thread.frame[1].GetFunctionName()
         self.assertTrue(name.startswith("___lldb_unnamed_symbol"))
         self.assertTrue(name.endswith("$$StripMe"))
-        
 
-        
+
+

diff  --git a/lldb/test/API/macosx/profile_vrs_detach/TestDetachVrsProfile.py b/lldb/test/API/macosx/profile_vrs_detach/TestDetachVrsProfile.py
index 31a9bce78cdc..cfb6e2472653 100644
--- a/lldb/test/API/macosx/profile_vrs_detach/TestDetachVrsProfile.py
+++ b/lldb/test/API/macosx/profile_vrs_detach/TestDetachVrsProfile.py
@@ -3,7 +3,7 @@
 till it had joined the profiling thread.  If the profiling interval
 was too long, that would mean it would take longer than the packet
 timeout to reply, and the detach would time out.  Make sure that doesn't
-happen. 
+happen.
 """
 
 
@@ -23,6 +23,7 @@ class TestDetachVrsProfile(TestBase):
 
     @skipUnlessDarwin
     @skipIfOutOfTreeDebugserver
+    @skipIfReproducer
     def test_profile_and_detach(self):
         """There can be many tests in a test case - describe this test here."""
         self.build()
@@ -55,14 +56,14 @@ def do_profile_and_detach(self):
 
         # We don't want to hit our breakpoint anymore.
         bkpt.SetEnabled(False)
-        
+
         # Record our process pid so we can kill it since we are going to detach...
         self.pid = process.GetProcessID()
         def cleanup():
             self.dbg.SetAsync(False)
             os.kill(self.pid, signal.SIGKILL)
         self.addTearDownHook(cleanup)
-        
+
         process.Continue()
 
         event = lldb.SBEvent()
@@ -70,7 +71,7 @@ def cleanup():
         self.assertTrue(success, "Got an event which should be running.")
         event_state = process.GetStateFromEvent(event)
         self.assertEqual(event_state, lldb.eStateRunning, "Got the running event")
-        
+
         # Now detach:
         error = process.Detach()
         self.assertTrue(error.Success(), "Detached successfully")

diff  --git a/lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py b/lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py
index 088972042e8b..887988b52d08 100644
--- a/lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py
+++ b/lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py
@@ -14,6 +14,7 @@ class TestInterruptThreadNames(TestBase):
 
     @skipUnlessDarwin
     @add_test_categories(['pyapi'])
+    @skipIfReproducer # While loop with non fixed number of iterations.
     def test_with_python_api(self):
         """Test that we get thread names when interrupting a process."""
         self.build()


        


More information about the lldb-commits mailing list