From 3af257824107a6a8596a5dc90a6ec97d1fc0f6e0 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sun, 9 Oct 2011 04:42:33 +0000 Subject: load each test on a random network port svn path=/trunk/; revision=15551 --- scripts/load_every_help.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/load_every_help.py b/scripts/load_every_help.py index 2189b51c..d08fcc93 100755 --- a/scripts/load_every_help.py +++ b/scripts/load_every_help.py @@ -1,6 +1,7 @@ #!/usr/bin/python import subprocess, sys, socket, time, os, re, time, smtplib, signal +import random try: pdrootdir = sys.argv[1] @@ -8,9 +9,6 @@ except IndexError: print 'only one arg: root dir of pd' sys.exit(2) -PORT = 55555 -netreceive_patch = '/tmp/.____pd_netreceive____.pd' - def find_pdexe(rootdir): # start with the Windows/Mac OS X location exe = pdrootdir + '/bin/pd' @@ -136,6 +134,8 @@ now = time.localtime(time.time()) date = time.strftime('20%y-%m-%d', now) datestamp = time.strftime('20%y-%m-%d_%H.%M.%S', now) +rand = random.SystemRandom() + outputfilename = 'load_every_help_' + socket.gethostname() + '_' + datestamp + '.log' outputfile = '/tmp/' + outputfilename fd = open(outputfile, 'w') @@ -145,8 +145,6 @@ fd.flush() logoutput = [] -make_netreceive_patch(netreceive_patch) - docdir = os.path.join(pdrootdir, 'doc') for root, dirs, files in os.walk(docdir): for name in files: @@ -154,6 +152,9 @@ for root, dirs, files in os.walk(docdir): if m: patchoutput = [] patch = os.path.join(root, m.string) + PORT = int(rand.random() * 10000) + int(rand.random() * 10000) + 40000 + netreceive_patch = '/tmp/.____pd_netreceive_'+str(PORT)+'____.pd' + make_netreceive_patch(netreceive_patch) p = launch_pd() try: open_patch(patch) -- cgit v1.2.1