-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[lldb][test] Fix type error when calling random.randrange with 'float' arg #97328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
b8830b5
to
108865d
Compare
@llvm/pr-subscribers-lldb Author: Kendal Harland (kendalharland) ChangesThis test only runs on Windows and fails because we're passing a literal of the wrong type to random.randrange. Full diff: https://github.com/llvm/llvm-project/pull/97328.diff 1 Files Affected:
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,
|
@@ -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))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about random.randrange(10000000000)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to leave it as the original author wrote it if that's alright. I'm assuming they found the shorthand more readable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I find it easier to read e10
than 0000000000
, so I'd also keep the style as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about 10**10
?
(As the "original author" ;), I'm not really sure what happened here. I'm pretty sure I did not write a huge blob of windows-specific code without testing it. It could be that newer python versions got more strict about typing or sth...)
I'm confused, I don't see this random call in Is your branch based off something other than the current |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but note that this file was moved (to packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
) recently, so you'll need to rebase this PR to HEAD.
@@ -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))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about 10**10
?
(As the "original author" ;), I'm not really sure what happened here. I'm pretty sure I did not write a huge blob of windows-specific code without testing it. It could be that newer python versions got more strict about typing or sth...)
108865d
to
9bb6749
Compare
9bb6749
to
a3c524b
Compare
Using |
I'll also need help merging this since I don't have write access to the repo. |
@kendalharland Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested Please check whether problems have been caused by your change specifically, as How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
This test only runs on Windows and fails because we're passing a literal of the wrong type to random.randrange.