Commit 0d263d58 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

CircleCI gets stuck for some reason... Try serialized execution

parent b5fb0b2e
......@@ -82,35 +82,46 @@ def main():
# Measure time to execute
start_time = time.time()
print("Spawning", total_cpus, "workers to run", total_tests, "tests...\n")
pool = multiprocessing.Pool(total_cpus)
try:
if os.getenv("CIRCLECI") is not None:
failed_tests = 0
run_tests = 0
results = pool.imap_unordered(build_me, get_tests())
for res in results:
for tst in get_tests():
res = build_me(tst)
run_tests += 1
test, result, msg = res
print("%40s: %s" % (test, color_me(result, msg)))
if not result:
failed_tests += 1
except KeyboardInterrupt:
# The devil is always in the details... This is the only
# way I found to propagate the SIGINT to the builds done
# by the worker processes of the pool AND immediately
# terminate. Numerous people cry about it on the web...
# ...and I had to look at the code of concurrent.futures
# (which I abandoned), multiprocessing/pool.py,
# multiprocessing/process.py AND subprocess.py to see
# what I had to do. Gotta love our profession.
for job in pool._pool: # pylint: disable=W0212
os.kill(job.pid, signal.SIGINT)
job.terminate()
pool.terminate()
pool.join()
else:
pool.close()
pool.join()
print("Spawning", total_cpus, "workers to run", total_tests, "tests...\n")
pool = multiprocessing.Pool(total_cpus)
try:
failed_tests = 0
run_tests = 0
results = pool.imap_unordered(build_me, get_tests())
for res in results:
run_tests += 1
test, result, msg = res
print("%40s: %s" % (test, color_me(result, msg)))
if not result:
failed_tests += 1
except KeyboardInterrupt:
# The devil is always in the details... This is the only
# way I found to propagate the SIGINT to the builds done
# by the worker processes of the pool AND immediately
# terminate. Numerous people cry about it on the web...
# ...and I had to look at the code of concurrent.futures
# (which I abandoned), multiprocessing/pool.py,
# multiprocessing/process.py AND subprocess.py to see
# what I had to do. Gotta love our profession.
for job in pool._pool: # pylint: disable=W0212
os.kill(job.pid, signal.SIGINT)
job.terminate()
pool.terminate()
pool.join()
else:
pool.close()
pool.join()
print("\nFinished in %d seconds." % (time.time() - start_time))
print(run_tests, "tests,", failed_tests, "failure" + (
......
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