Commit 4e0b0b6b authored by Jim Fulton's avatar Jim Fulton

Fix tests for Python 2

For some reason, installation is taking insanely long for Python 2
(10x Py3). NFC, but this bears further investication, given that it's just copying eggs, except pyc re-compilation to get correct path.

- Now wait up to 99 seconds for builds to complete.

- handle build timeout by printing output (rather than a failing
  assertion, now that we know it can happen).

- Got rid of the broken out() function.
parent 0c5b9e80
...@@ -3685,6 +3685,8 @@ def test_suite(): ...@@ -3685,6 +3685,8 @@ def test_suite():
def docSetUp(test): def docSetUp(test):
extra_options = ( extra_options = (
" use-dependency-links=false" " use-dependency-links=false"
# Leaving this here so we can uncomment to see what's going on.
#" log-format=%(asctime)s____%(levelname)s_%(message)s -vvv"
" index=" + os.path.join(ancestor(__file__, 4), 'doc') " index=" + os.path.join(ancestor(__file__, 4), 'doc')
) )
def run_buildout_in_process(command='buildout'): def run_buildout_in_process(command='buildout'):
...@@ -3694,18 +3696,14 @@ def test_suite(): ...@@ -3694,18 +3696,14 @@ def test_suite():
) )
process.daemon = True process.daemon = True
process.start() process.start()
process.join(9) process.join(99)
assert not process.is_alive() if process.is_alive() or process.exitcode:
if process.exitcode: print(read())
print(out())
def read(path): def read(path='out'):
with open(path) as f: with open(path) as f:
return f.read() return f.read()
def out():
read('out')
def write(text, path): def write(text, path):
with open(path, 'w') as f: with open(path, 'w') as f:
f.write(text) f.write(text)
...@@ -3717,7 +3715,6 @@ def test_suite(): ...@@ -3717,7 +3715,6 @@ def test_suite():
eq=lambda a, b: None if a == b else (a, b), eq=lambda a, b: None if a == b else (a, b),
eqs=lambda a, *b: None if set(a) == set(b) else (a, b), eqs=lambda a, *b: None if set(a) == set(b) else (a, b),
read=read, read=read,
out=out,
write=write, write=write,
) )
setupstack.setUpDirectory(test) setupstack.setUpDirectory(test)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment