• Dylan Baker's avatar
    framework: fix running with mixed concurrency (neither -c or -1) · 597e4844
    Dylan Baker authored
    test_list is an iterator, you can't walk an iterator more than once. To
    solve this we use itertools.tee, which creates a shared buffer for the
    iterators to draw from. This fixes errors like:
    
    [000/480]
    Traceback (most recent call last):
      File "./piglit", line 178, in <module>
        main()
      File "./piglit", line 174, in main
        sys.exit(runner(args))
      File "/home/user/piglit/framework/exceptions.py", line 51, in _inner
        func(*args, **kwargs)
      File "/home/user/piglit/framework/programs/run.py", line 370, in run
        backend.finalize({'time_elapsed': time_elapsed.to_json()})
      File "/home/user/piglit/framework/backends/json.py", line 163, in finalize
        assert data['tests']
      AssertionError
    
    Thanks Tomi for figuring out what was wrong with the original patch!
    
    CC: Tomi Sarvela <tomi.p.sarvela@intel.com>
    Tested-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
    Reviewed-by: Juan Suárez Romero's avatarJuan A. Suarez <jasuarez@igalia.com>
    597e4844
Name
Last commit
Last update
ci/appveyor Loading commit data...
cmake Loading commit data...
completions/bash Loading commit data...
docker Loading commit data...
examples/glsl_parser_test Loading commit data...
framework Loading commit data...
generated_tests Loading commit data...
licences Loading commit data...
registry Loading commit data...
self-tests Loading commit data...
src Loading commit data...
templates Loading commit data...
tests Loading commit data...
unittests Loading commit data...
.dir-locals.el Loading commit data...
.editorconfig Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CMakeLists.txt Loading commit data...
COPYING Loading commit data...
HACKING Loading commit data...
README Loading commit data...
RELEASE Loading commit data...
TODO Loading commit data...
appveyor.yml Loading commit data...
piglit Loading commit data...
piglit-print-commands.py Loading commit data...
piglit-resume.py Loading commit data...
piglit-run.py Loading commit data...
piglit-summary-html.py Loading commit data...
piglit-summary.py Loading commit data...
piglit.conf.example Loading commit data...
tox.ini Loading commit data...