[Lldb-commits] [lldb] Fix up the TestGlobalModuleCache showing we succeed mostly. (PR #84099)

via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 5 16:52:05 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r 489eadd142e858dc28e375320da774eba53d21bb...29866d5a183097348cb4d5b2bf3ec66f2fc0ccc4 lldb/test/API/python_api/global_module_cache/TestGlobalModuleCache.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- TestGlobalModuleCache.py	2024-03-06 00:32:40.000000 +0000
+++ TestGlobalModuleCache.py	2024-03-06 00:51:57.488092 +0000
@@ -48,33 +48,32 @@
     # the bug this is exposing (https://github.com/llvm/llvm-project/issues/76057).
     @skipIf(oslist=["linux"], archs=["arm", "aarch64"])
     def test_OneTargetOneDebugger(self):
         self.do_test(True, True)
 
-
     @skipIfWindows
     @skipIf(oslist=["linux"], archs=["arm", "aarch64"])
     def test_TwoTargetsOneDebugger(self):
         self.do_test(False, True)
 
-    @expectedFailureAll() # An external reference keeps modules alive
+    @expectedFailureAll()  # An external reference keeps modules alive
     @skipIfWindows
     @skipIf(oslist=["linux"], archs=["arm", "aarch64"])
     def test_TwoTargetsOneDebuggerWithPin(self):
         self.do_test(False, True, True)
 
     @skipIfWindows
     @skipIf(oslist=["linux"], archs=["arm", "aarch64"])
     def test_TwoTargetsTwoDebuggers(self):
         self.do_test(False, False)
 
-    @expectedFailureAll() # An external reference keeps modules alive
-    #@skipIfWindows
-    #@skipIf(oslist=["linux"], archs=["arm", "aarch64"])
+    @expectedFailureAll()  # An external reference keeps modules alive
+    # @skipIfWindows
+    # @skipIf(oslist=["linux"], archs=["arm", "aarch64"])
     def test_TwoTargetsTwoDebuggersWithPin(self):
         self.do_test(False, False, True)
-        
+
     def do_test(self, one_target, one_debugger, use_pinning_module=False):
         # Make sure that if we have one target, and we run, then
         # change the binary and rerun, the binary (and any .o files
         # if using dwarf in .o file debugging) get removed from the
         # shared module cache.  They are no longer reachable.
@@ -109,16 +108,18 @@
 
         self.pinning_module = None
         if use_pinning_module:
             self.pinning_module = target.FindModule(target.executable)
             self.assertTrue(self.pinning_module.IsValid(), "Valid pinning module")
+
             def cleanupPinningModule(self):
                 if self.pinning_module:
                     self.pinning_module.Clear()
                     self.pinning_module = None
+
             self.addTearDownHook(cleanupPinningModule)
-                
+
         # Make sure we ran the version we intended here:
         self.check_counter_var(thread, 1)
         process.Kill()
 
         # Now copy two-print.c over main.c, rebuild, and rerun:
@@ -188,12 +189,13 @@
         error = self.check_image_list_result(num_a_dot_out_entries, 1)
         # Even if this fails, MemoryPressureDetected should fix this.
         if self.TraceOn():
             print("*** Calling MemoryPressureDetected")
         lldb.SBDebugger.MemoryPressureDetected()
-        error_after_mpd = self.check_image_list_result(num_a_dot_out_entries,
-                                                       num_main_dot_o_entries)
+        error_after_mpd = self.check_image_list_result(
+            num_a_dot_out_entries, num_main_dot_o_entries
+        )
         fail_msg = ""
         if error != "":
             fail_msg = "Error before MPD: " + error
 
         if error_after_mpd != "":

``````````

</details>


https://github.com/llvm/llvm-project/pull/84099


More information about the lldb-commits mailing list