From bde5cb4376df9ad59db26e7083d91ed12e107970 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 8 May 2018 12:18:06 -0700 Subject: framework: ensure that all tests are run before exiting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a bug that has existed for a long time, and I'm not really sure how we haven't hit this before honestly, I think that the reason this has worked is that we've always provided a concrete type to to pool.imap. The problem is that pool.imap is an iterator. If you don't walk the results then the program might exit before finishing. This seems to be especially true when running without -c or -1. Instead we'll write the loop, using pool.apply_async does basically the same thing (without the ability to use chunks), but with out exiting early. Tested-by: Michel Dänzer --- framework/profile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/profile.py b/framework/profile.py index 5161f6e4c..44681592a 100644 --- a/framework/profile.py +++ b/framework/profile.py @@ -584,8 +584,8 @@ def run(profiles, logger, backend, concurrency): # more code, and adding side-effects test_list = (x for x in test_list if filterby(x)) - pool.imap(lambda pair: test(pair[0], pair[1], profile, pool), - test_list, chunksize) + for n, t in test_list: + pool.apply_async(test, [n, t, profile, pool]) def run_profile(profile, test_list): """Run an individual profile.""" -- cgit v1.2.3