Skip to content
  • 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: default avatarMichel Dänzer <michel.daenzer@amd.com>
    Reviewed-by: default avatarJuan A. Suarez <jasuarez@igalia.com>
    597e4844