This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add --randseed to regrtest
Type: enhancement Stage: patch review
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: collinwinter, mark.dickinson, pitrou
Priority: normal Keywords: needs review, patch

Created on 2009-03-28 18:58 by collinwinter, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
randseed.patch collinwinter, 2009-03-28 23:04 Address comments in msg84341
Messages (7)
msg84322 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2009-03-28 18:58
Add the ability to control the random seed used by regrtest.py -r. This
patch adds a --randseed option, and makes regrtest.py -r indicate what
random seed it's using so that that value can later be fed back to
--randseed. This option is useful for tracking down test order-related
issues found by make buildbottest, for example.
msg84341 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-03-28 22:52
+1 on the idea.

I'm not sure I understand the patch, though.  If the line:

random_seed = int(1000000 * random.random())

produces a random_seed of 0 (or if randseed=0 is supplied as an option), 
it looks as though random.seed is never called;  is this intentional?

Also, not that it really matters, but why do you use the expression above 
instead of the simpler random.randrange(1000000)?
msg84344 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2009-03-28 23:04
The "if rand_seed:" bit was a relic from a previous iteration; fixed.
The only reason I didn't use randrange() is that I didn't see it; fixed.
msg84345 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-03-28 23:04
+1 here too.
msg84348 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-03-28 23:10
Updated patch looks good to me.
msg84365 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2009-03-29 04:05
Committed as r70672 (trunk) and r70673 (py3k). Thanks for the quick review.
msg84395 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-03-29 13:25
Should this get a Misc/NEWS entry?
History
Date User Action Args
2022-04-11 14:56:47adminsetgithub: 49838
2009-03-29 13:25:51mark.dickinsonsetmessages: + msg84395
2009-03-29 04:05:40collinwintersetstatus: open -> closed
resolution: accepted
messages: + msg84365
2009-03-28 23:10:08mark.dickinsonsetmessages: + msg84348
2009-03-28 23:04:26pitrousetnosy: + pitrou
messages: + msg84345
2009-03-28 23:04:15collinwintersetfiles: - randseed.patch
2009-03-28 23:04:08collinwintersetfiles: + randseed.patch

messages: + msg84344
2009-03-28 22:52:03mark.dickinsonsetnosy: + mark.dickinson
messages: + msg84341
2009-03-28 18:58:10collinwintercreate