mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
intel/compiler tests: rewrite subprocess handling in run-test.py
`subprocess.Popen()` returns immediately, and the subprocess might not have finished by the time `stdout` is read on the next line, spuriously failing the tests. `subprocess.check_output()` makes sure the output is available before returning, solving this issue; it additionally raises an error if the subprocess failed, giving a better error than a failed diff later in the script. cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34756>
This commit is contained in:
parent
60796c85d1
commit
de6ab1beda
2 changed files with 4 additions and 8 deletions
|
|
@ -48,10 +48,8 @@ for asm_file in args.gen_folder.glob('*.asm'):
|
|||
'--gen', args.gen_name,
|
||||
asm_file
|
||||
]
|
||||
with subprocess.Popen(command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.DEVNULL) as cmd:
|
||||
lines_after = [line.decode('ascii') for line in cmd.stdout.readlines()]
|
||||
stdout = subprocess.check_output(command, timeout=1).decode()
|
||||
lines_after = stdout.splitlines(keepends=True)
|
||||
except OSError as e:
|
||||
if e.errno == errno.ENOEXEC:
|
||||
print('Skipping due to inability to run host binaries.',
|
||||
|
|
|
|||
|
|
@ -48,10 +48,8 @@ for asm_file in args.gen_folder.glob('*.asm'):
|
|||
'--gen', args.gen_name,
|
||||
asm_file
|
||||
]
|
||||
with subprocess.Popen(command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.DEVNULL) as cmd:
|
||||
lines_after = [line.decode('ascii') for line in cmd.stdout.readlines()]
|
||||
stdout = subprocess.check_output(command, timeout=1).decode()
|
||||
lines_after = stdout.splitlines(keepends=True)
|
||||
except OSError as e:
|
||||
if e.errno == errno.ENOEXEC:
|
||||
print('Skipping due to inability to run host binaries.',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue