[Lldb-commits] [lldb] 5238b80 - [lldb/Reproducers] Skip or fix the remaining tests.

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed May 27 21:03:27 PDT 2020


Author: Jonas Devlieghere
Date: 2020-05-27T21:02:36-07:00
New Revision: 5238b80058a6d096220eb9fbf606d9d983f37b0b

URL: https://github.com/llvm/llvm-project/commit/5238b80058a6d096220eb9fbf606d9d983f37b0b
DIFF: https://github.com/llvm/llvm-project/commit/5238b80058a6d096220eb9fbf606d9d983f37b0b.diff

LOG: [lldb/Reproducers] Skip or fix the remaining tests.

After this patch all remaining tests should pass on macOS when replayed
from a reproducer.

To capture the reproducers:

  ./bin/llvm-lit ../llvm-project/lldb/test/ --param lldb-run-with-repro=capture

To replay the reproducers:

  ./bin/llvm-lit ../llvm-project/lldb/test/ --param lldb-run-with-repro=replay

Added: 
    

Modified: 
    lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py
    lldb/test/API/functionalities/load_unload/TestLoadUnload.py
    lldb/test/API/functionalities/load_using_paths/TestLoadUsingPaths.py
    lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
    lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py
    lldb/test/API/functionalities/thread/exit_during_expression/TestExitDuringExpression.py
    lldb/test/API/lang/cpp/thread_local/TestThreadLocal.py
    lldb/test/API/macosx/version_zero/TestGetVersionZeroVersion.py
    lldb/test/API/python_api/symbol-context/TestSymbolContext.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py b/lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py
index 73bd292463f0..83fa197c2fe3 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py
@@ -6,6 +6,7 @@
 
 class TestWriteMemory(GDBRemoteTestBase):
 
+    @skipIfReproducer # SBProcess::WriteMemory is not instrumented.
     def test(self):
 
         class MyResponder(MockGDBServerResponder):

diff  --git a/lldb/test/API/functionalities/load_unload/TestLoadUnload.py b/lldb/test/API/functionalities/load_unload/TestLoadUnload.py
index 853c0b2cea20..538f7b1734ba 100644
--- a/lldb/test/API/functionalities/load_unload/TestLoadUnload.py
+++ b/lldb/test/API/functionalities/load_unload/TestLoadUnload.py
@@ -223,6 +223,7 @@ def test_lldb_process_load_and_unload_commands_with_svr4(self):
         self.setSvr4Support(True)
         self.run_lldb_process_load_and_unload_commands()
 
+    @skipIfReproducer # FIXME: Unexpected packet during (passive) replay
     def run_lldb_process_load_and_unload_commands(self):
         """Test that lldb process load/unload command work correctly."""
         self.copy_shlibs_to_remote()

diff  --git a/lldb/test/API/functionalities/load_using_paths/TestLoadUsingPaths.py b/lldb/test/API/functionalities/load_using_paths/TestLoadUsingPaths.py
index a7d5f07a0976..9e10bd3ce833 100644
--- a/lldb/test/API/functionalities/load_using_paths/TestLoadUsingPaths.py
+++ b/lldb/test/API/functionalities/load_using_paths/TestLoadUsingPaths.py
@@ -41,6 +41,7 @@ def setUp(self):
     @skipIfWindows  # Windows doesn't have dlopen and friends, dynamic libraries work 
diff erently
     @expectedFlakeyNetBSD
     @expectedFailureAll(oslist=["linux"], archs=['arm'], bugnumber="llvm.org/pr45894")
+    @skipIfReproducer # FIXME: Unexpected packet during (passive) replay
     def test_load_using_paths(self):
         """Test that we can load a module by providing a set of search paths."""
         if self.platformIsDarwin():

diff  --git a/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py b/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
index 3e1abc3353c3..012f9b67d9e3 100644
--- a/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
+++ b/lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
@@ -344,6 +344,7 @@ def test_deeper_stack_in_minidump(self):
                                   "linux-x86_64_not_crashed.dmp",
                                   self._linux_x86_64_not_crashed_pid)
 
+    @skipIfReproducer # VFS is a snapshot.
     def do_change_pid_in_minidump(self, core, newcore, offset, oldpid, newpid):
         """ This assumes that the minidump is breakpad generated on Linux -
         meaning that the PID in the file will be an ascii string part of

diff  --git a/lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py b/lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py
index 93597b4edae3..124d13ed97a4 100644
--- a/lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py
+++ b/lldb/test/API/functionalities/process_group/TestChangeProcessGroup.py
@@ -24,6 +24,7 @@ def setUp(self):
     @skipIfWindows  # setpgid call does not exist on Windows
     @expectedFailureAndroid("http://llvm.org/pr23762", api_levels=[16])
     @expectedFailureNetBSD
+    @skipIfReproducer # File synchronization is not supported during replay.
     def test_setpgid(self):
         self.build()
         exe = self.getBuildArtifact("a.out")

diff  --git a/lldb/test/API/functionalities/thread/exit_during_expression/TestExitDuringExpression.py b/lldb/test/API/functionalities/thread/exit_during_expression/TestExitDuringExpression.py
index bfdfdf53cdb1..260fe596a39f 100644
--- a/lldb/test/API/functionalities/thread/exit_during_expression/TestExitDuringExpression.py
+++ b/lldb/test/API/functionalities/thread/exit_during_expression/TestExitDuringExpression.py
@@ -33,12 +33,13 @@ def test_exit_after_one_thread_unwind(self):
     def test_exit_after_one_thread_no_unwind(self):
         """Test the case where we exit within the one thread timeout"""
         self.exiting_expression_test(False, False)
-    
+
     def setUp(self):
         TestBase.setUp(self)
         self.main_source_file = lldb.SBFileSpec("main.c")
         self.build()
-        
+
+    @skipIfReproducer # Timeouts are not currently modeled.
     def exiting_expression_test(self, before_one_thread_timeout , unwind):
         """function_to_call sleeps for g_timeout microseconds, then calls pthread_exit.
            This test calls function_to_call with an overall timeout of 500
@@ -46,7 +47,7 @@ def exiting_expression_test(self, before_one_thread_timeout , unwind):
            It also sets unwind_on_exit for the call to the unwind passed in.
            This allows you to have the thread exit either before the one thread
            timeout is passed. """
-        
+
         (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
                                    "Break here and cause the thread to exit", self.main_source_file)
 
@@ -59,15 +60,15 @@ def exiting_expression_test(self, before_one_thread_timeout , unwind):
         var_options.SetIncludeArguments(False)
         var_options.SetIncludeLocals(False)
         var_options.SetIncludeStatics(True)
-        
+
         value_list = frame.GetVariables(var_options)
         g_timeout = value_list.GetFirstValueByName("g_timeout")
         self.assertTrue(g_timeout.IsValid(), "Found g_timeout")
-        
+
         error = lldb.SBError()
         timeout_value = g_timeout.GetValueAsUnsigned(error)
         self.assertTrue(error.Success(), "Couldn't get timeout value: %s"%(error.GetCString()))
-        
+
         one_thread_timeout = 0
         if (before_one_thread_timeout):
             one_thread_timeout = timeout_value * 2
@@ -78,7 +79,7 @@ def exiting_expression_test(self, before_one_thread_timeout , unwind):
         options.SetUnwindOnError(unwind)
         options.SetOneThreadTimeoutInMicroSeconds(one_thread_timeout)
         options.SetTimeoutInMicroSeconds(4 * timeout_value)
-            
+
         result = frame.EvaluateExpression("function_to_call()", options)
 
         # Make sure the thread actually exited:
@@ -103,4 +104,4 @@ def exiting_expression_test(self, before_one_thread_timeout , unwind):
         ret_val_value = ret_val.GetValueAsSigned(error)
         self.assertTrue(error.Success(), "Got ret_val's value")
         self.assertEqual(ret_val_value, 10, "We put the right value in ret_val")
-        
+

diff  --git a/lldb/test/API/lang/cpp/thread_local/TestThreadLocal.py b/lldb/test/API/lang/cpp/thread_local/TestThreadLocal.py
index e7cfa1ca14f2..b92ec90ff77d 100644
--- a/lldb/test/API/lang/cpp/thread_local/TestThreadLocal.py
+++ b/lldb/test/API/lang/cpp/thread_local/TestThreadLocal.py
@@ -30,10 +30,25 @@ def test_thread_local(self):
         self.expect_expr("*tl_global_ptr",
                          result_type="int", result_value="45")
 
+        # Create the filespec by which to locate our a.out module.
+        #
+        #  - Use the absolute path to get the module for the current variant.
+        #  - Use the relative path for reproducers. The modules are never
+        #    orphaned because the SB objects are leaked intentionally. This
+        #    causes LLDB to reuse the same module for every variant, because the
+        #    UUID is the same for all the inferiors. FindModule below only
+        #    compares paths and is oblivious to the fact that the UUIDs are the
+        #    same.
+        if configuration.is_reproducer():
+            filespec = lldb.SBFileSpec('a.out', False)
+        else:
+            filespec = lldb.SBFileSpec(exe, False)
+
         # Now see if we emit the correct error when the TLS is not yet
         # initialized. Let's set a breakpoint on the first instruction
         # of main.
-        main_module = target.FindModule(lldb.SBFileSpec(exe))
+        main_module = target.FindModule(filespec)
+        self.assertTrue(main_module, VALID_MODULE)
         main_address = main_module.FindSymbol("main").GetStartAddress()
         main_bkpt = target.BreakpointCreateBySBAddress(main_address)
 

diff  --git a/lldb/test/API/macosx/version_zero/TestGetVersionZeroVersion.py b/lldb/test/API/macosx/version_zero/TestGetVersionZeroVersion.py
index f7e4da73dda6..53a59c923d84 100644
--- a/lldb/test/API/macosx/version_zero/TestGetVersionZeroVersion.py
+++ b/lldb/test/API/macosx/version_zero/TestGetVersionZeroVersion.py
@@ -19,6 +19,7 @@ class TestGetVersionForZero(TestBase):
     # each debug info format.
     NO_DEBUG_INFO_TESTCASE = True
 
+    @skipIfReproducer # FIXME: Unexpected packet during (passive) replay
     def test_get_version_zero(self):
         """Read in a library with a version of 0.0.0.  Test SBModule::GetVersion"""
         self.yaml2obj("libDylib.dylib.yaml", self.getBuildArtifact("libDylib.dylib"))

diff  --git a/lldb/test/API/python_api/symbol-context/TestSymbolContext.py b/lldb/test/API/python_api/symbol-context/TestSymbolContext.py
index 0baf91e4a351..cbe4eff0a5e3 100644
--- a/lldb/test/API/python_api/symbol-context/TestSymbolContext.py
+++ b/lldb/test/API/python_api/symbol-context/TestSymbolContext.py
@@ -23,6 +23,7 @@ def setUp(self):
 
     @add_test_categories(['pyapi'])
     @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
+    @skipIfReproducer # FIXME: Unexpected packet during (passive) replay
     def test(self):
         """Exercise SBSymbolContext API extensively."""
         self.build()


        


More information about the lldb-commits mailing list