glsl/tests: Don't use tempfiles
authorMichel Dänzer <mdaenzer@redhat.com>
Fri, 5 Mar 2021 22:05:51 +0000 (23:05 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 19 Mar 2021 08:50:37 +0000 (08:50 +0000)
commit4cc8c25d5615647203d0c861de1ecd193bd29fe9
treed8450ee00da4a2414d6765d44617a063052cd7bf
parentdeb654cdd00470187341bb7aacf1fc2a6d1c4e25
glsl/tests: Don't use tempfiles

Use pipes for direct communication between child & parent process.

Using tempfiles sometimes resulted in hitting the meson timeout if there
was high filesystem pressure (I saw a single unlink system call take as
long as 4 seconds; attempts to re-use a single tempfile just shifted the
delays to truncate/close systems calls).

As a bonus, this gets the valgrind test actually working as intended.
It wasn't working because the tempfile passed to --log-file didn't exist
(due to the earlier os.close(fd)?).

v2:
* Wrap .read() in "with open()" (Dylan Baker)

Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9528>
src/compiler/glsl/glcpp/tests/glcpp_test.py