[Lldb-commits] [lldb] Fix type error when calling random.randrange with 'float' arg (PR #97328)

Kendal Harland via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 1 10:35:23 PDT 2024


https://github.com/kendalharland created https://github.com/llvm/llvm-project/pull/97328

This test only runs on Windows and fails because we're passing a literal of the wrong type to random.randrange.

>From 68c7fe6a0bf4a2385587a563c06892cd7b4eaea8 Mon Sep 17 00:00:00 2001
From: kendal <kendal at thebrowser.company>
Date: Mon, 1 Jul 2024 10:20:08 -0700
Subject: [PATCH 1/2] Disable TestUseSourceCache on Windows amd64

This test also fails on Windows amd64, although it is only
disabled for aarch64.
---
 .../commands/settings/use_source_cache/TestUseSourceCache.py    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/test/API/commands/settings/use_source_cache/TestUseSourceCache.py b/lldb/test/API/commands/settings/use_source_cache/TestUseSourceCache.py
index c54345af4994c..421599080a9e5 100644
--- a/lldb/test/API/commands/settings/use_source_cache/TestUseSourceCache.py
+++ b/lldb/test/API/commands/settings/use_source_cache/TestUseSourceCache.py
@@ -18,7 +18,7 @@ def test_set_use_source_cache_false(self):
         self.set_use_source_cache_and_test(False)
 
     @skipIf(hostoslist=no_match(["windows"]))
-    @skipIf(oslist=["windows"], archs=["aarch64"])  # Fails on windows 11
+    @skipIf(oslist=["windows"])  # Fails on windows 11
     def test_set_use_source_cache_true(self):
         """Test that after 'set use-source-cache false', files are locked."""
         self.set_use_source_cache_and_test(True)

>From b8830b5c963e2b59d7265bc84473c5973ac1258f Mon Sep 17 00:00:00 2001
From: kendal <kendal at thebrowser.company>
Date: Mon, 1 Jul 2024 10:33:51 -0700
Subject: [PATCH 2/2] Fix type error when calling random.randrange with 'float'
 arg

---
 .../tools/lldb-server/commandline/TestGdbRemoteConnection.py    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/test/API/tools/lldb-server/commandline/TestGdbRemoteConnection.py b/lldb/test/API/tools/lldb-server/commandline/TestGdbRemoteConnection.py
index 853b7ad5ef290..f31a57b767c72 100644
--- a/lldb/test/API/tools/lldb-server/commandline/TestGdbRemoteConnection.py
+++ b/lldb/test/API/tools/lldb-server/commandline/TestGdbRemoteConnection.py
@@ -75,7 +75,7 @@ def __init__(self):
     class Pipe(object):
         def __init__(self, prefix):
             while True:
-                self.name = "lldb-" + str(random.randrange(1e10))
+                self.name = "lldb-" + str(random.randrange(int(1e10)))
                 full_name = "\\\\.\\pipe\\" + self.name
                 self._handle = CreateNamedPipe(
                     full_name,



More information about the lldb-commits mailing list