redo.py: shuffle the list of targets.

This encourages greater randomness in builds, which both decreases lock
contention and should help with testing the consistency of parallel builds.
This commit is contained in:
Avery Pennarun 2010-11-13 04:42:13 -08:00
commit 9d5afd67f0

View file

@ -1,5 +1,5 @@
#!/usr/bin/python #!/usr/bin/python
import sys, os, subprocess, glob, time import sys, os, subprocess, glob, time, random
import options, jwack import options, jwack
optspec = """ optspec = """
@ -146,6 +146,7 @@ def main():
retcode = 0 retcode = 0
locked = {} locked = {}
waits = {} waits = {}
random.shuffle(targets) # make it unpredictable for better testing
for t in targets: for t in targets:
if os.path.exists('%s/all.do' % t): if os.path.exists('%s/all.do' % t):
# t is a directory, but it has a default target # t is a directory, but it has a default target