Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-133489: Remove size restrictions on getrandbits() and randbytes()#133658
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-133489: Remove size restrictions on getrandbits() and randbytes()#133658
Conversation
…tes()random.getrandbits() can now generate more that 2**31 bits.random.randbytes() can now generate more that 256 MiB.
@@ -806,6 +806,20 @@ def test_getrandbits(self): | |||
self.assertEqual(self.gen.getrandbits(100), | |||
97904845777343510404718956115) | |||
def test_getrandbits_2G_bits(self): |
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.
Shouldn't this be decorated with bigmemtest? Ditto the second test.
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.
It requires only 800 MB of memory. Too small for bigmemtest. The second test requires about 1300 MB of memory. This may be too small too, but I'm going to add bigmemtest after testing on 32-bit buildbots.
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.
It requires only 800 MB of memory. Too small for bigmemtest.
Where is the boundary? IIRC, memory limit is configurable.
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.
It was 1GiB (you could not specify less than 1 GiB for -M option in regrtest). But now it seems is 2 GiB.
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.
Actually, it was initially 2.5 GiB, then lowered to 2 GiB. But I add bigmemtest even for some tests that need 1-2 GiB.
!buildbot 32 |
bedevere-bot commentedMay 8, 2025
🤖 New build scheduled with the buildbot fleet by@serhiy-storchaka for commit24cbd8d 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133658%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
!buildbot android |
bedevere-bot commentedMay 8, 2025
🤖 New build scheduled with the buildbot fleet by@serhiy-storchaka for commit24cbd8d 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133658%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
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.
also consider tagging any of the new tests that take a long time to run (especially from a GH CI perspective) as@support.requires_resource("cpu")
.
The new non-bigmem test takes 1 second on my computer. I usually only mark tests that take more than 5 seconds.
|
68784fe
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…tes() (pythonGH-133658)random.getrandbits() can now generate more that 2**31 bits.random.randbytes() can now generate more that 256 MiB.(cherry picked from commit68784fe)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sorry,@serhiy-storchaka, I could not cleanly backport this to
|
GH-134964 is a backport of this pull request to the3.14 branch. |
… randbytes() (pythonGH-133658)random.getrandbits() can now generate more that 2**31 bits.random.randbytes() can now generate more that 256 MiB.(cherry picked from commit68784fe)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-134965 is a backport of this pull request to the3.13 branch. |
Uh oh!
There was an error while loading.Please reload this page.
random.getrandbits() can now generate more that 2**31 bits. random.randbytes() can now generate more that 256 MiB.