Skip to content

Commit

Permalink
Parametrize slowness of the CI machine.
Browse files Browse the repository at this point in the history
  • Loading branch information
majek committed Jul 8, 2011
1 parent b0a44e3 commit 05a8c3d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import sys
import os

multiplier = float(os.environ.get('SLOWNESS', 1))

def run(cmd, **kwargs):
p = subprocess.Popen(cmd.split(),
stdout=subprocess.PIPE,
Expand All @@ -16,15 +18,15 @@ def run(cmd, **kwargs):
out = p.stdout.read()
err = p.stderr.read()

time.sleep(0.2)
time.sleep(0.2 * multiplier)
return p.returncode, out + '\n' + err

def spawn(cmd, **kwargs):
p = subprocess.Popen(cmd.split(),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
**kwargs)
time.sleep(0.5)
time.sleep(0.5 * multiplier)
return p

def wait(p, match):
Expand Down Expand Up @@ -84,6 +86,7 @@ def skip(cwd_cmd, to_skip):

errors = 0

print " [.] Running tests with SLOWNESS=%r" % (multiplier,)
for test in sorted(tests.keys()):
(send_progs, recv_progs, output_mask) = tests[test]
for scwd, send_cmd in send_progs:
Expand Down

0 comments on commit 05a8c3d

Please sign in to comment.