[Lldb-commits] [lldb] 15f067f - [lldb] [test] Workaround symlink-related test failures

Michał Górny via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 1 07:24:37 PST 2021


Author: Michał Górny
Date: 2021-03-01T16:23:36+01:00
New Revision: 15f067f1c79fac34910eaf50f612854eb1d58bb5

URL: https://github.com/llvm/llvm-project/commit/15f067f1c79fac34910eaf50f612854eb1d58bb5
DIFF: https://github.com/llvm/llvm-project/commit/15f067f1c79fac34910eaf50f612854eb1d58bb5.diff

LOG: [lldb] [test] Workaround symlink-related test failures

Use realpath() when spawning the executable create_after_attach
to workaround a FreeBSD plugin (and possibly others) problem.
If the executable is started via a path containing a symlink, it is
added to the module list twice -- via the real and apparent path.
This in turn cases the requested breakpoint to resolve twice.

Use realpath() for main program path in lldb-vscode breakpoint tests
to workaround a similar problem.  If the passed path does not match
the realpath, lldb-vscode does not report the breakpoints as verified
and causes tests to fail.

Since the underlying problems are non-trivial to fix and the purpose
of these tests is not to reproduce symlink problems, let's apply
trivial workarounds to make them pass.

Differential Revision: https://reviews.llvm.org/D97230

Added: 
    

Modified: 
    lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
    lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py b/lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
index cba6712a8021..e9c85d5025a8 100644
--- a/lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
+++ b/lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
@@ -25,7 +25,6 @@ def setUp(self):
     # Occasionally hangs on Windows, may be same as other issues.
     @skipIfWindows
     @skipIfiOSSimulator
-    @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48376")
     @expectedFailureNetBSD
     def test_create_after_attach(self):
         """Test thread creation after process attach."""
@@ -33,7 +32,8 @@ def test_create_after_attach(self):
         exe = self.getBuildArtifact("a.out")
 
         # Spawn a new process
-        popen = self.spawnSubprocess(exe)
+        # use realpath to workaround llvm.org/pr48376
+        popen = self.spawnSubprocess(os.path.realpath(exe))
         pid = popen.pid
 
         # Attach to the spawned process

diff  --git a/lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py b/lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py
index 2323d277a633..5c129cb91825 100644
--- a/lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py
+++ b/lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py
@@ -21,11 +21,10 @@ def setUp(self):
         lldbvscode_testcase.VSCodeTestCaseBase.setUp(self)
 
         self.main_basename = 'main-copy.cpp'
-        self.main_path = self.getBuildArtifact(self.main_basename)
+        self.main_path = os.path.realpath(self.getBuildArtifact(self.main_basename))
 
     @skipIfWindows
     @skipIfRemote
-    @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48421")
     def test_source_map(self):
         self.build_and_create_debug_adaptor()
 
@@ -90,7 +89,6 @@ def test_source_map(self):
 
     @skipIfWindows
     @skipIfRemote
-    @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48421")
     def test_set_and_clear(self):
         '''Tests setting and clearing source file and line breakpoints.
            This packet is a bit tricky on the debug adaptor side since there
@@ -223,7 +221,6 @@ def test_set_and_clear(self):
 
     @skipIfWindows
     @skipIfRemote
-    @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48421")
     def test_clear_breakpoints_unset_breakpoints(self):
         '''Test clearing breakpoints like test_set_and_clear, but clear
            breakpoints by omitting the breakpoints array instead of sending an
@@ -266,7 +263,6 @@ def test_clear_breakpoints_unset_breakpoints(self):
 
     @skipIfWindows
     @skipIfRemote
-    @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48421")
     def test_functionality(self):
         '''Tests hitting breakpoints and the functionality of a single
            breakpoint, like 'conditions' and 'hitCondition' settings.'''


        


More information about the lldb-commits mailing list