[Piglit] [PATCH 1/4] framework: ensure that all tests are run before exiting

Dylan Baker dylan at pnwbakers.com
Tue May 8 21:22:04 UTC 2018


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.
---
 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."""
-- 
2.17.0



More information about the Piglit mailing list