From cf68570813f48fc360d5f175cf4954d095527d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Fri, 23 Oct 2020 12:23:16 +0200 Subject: [PATCH] Testsuite: workaround for glibc bug #19329 This bug is causing random crashes in the testsuite on our runners. See https://sourceware.org/bugzilla/show_bug.cgi?id=19329 (cherry picked from commit f46dfba96112bd3859565722cadf8b47b6b69b25) --- tests/Makefile.am | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 6bc0adf1b..2c5bcec7c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1229,9 +1229,13 @@ check-matlab-ols: $(M_OLS_TRS_FILES) %.m.trs %.m.log: %.mod @echo "`tput bold``tput setaf 8`MATLAB: $(CURDIR)/$*... `tput sgr0`" - @DYNARE_VERSION="$(PACKAGE_VERSION)" TOP_TEST_DIR="$(CURDIR)" FILESTEM="$*" \ - $(MATLAB)/bin/matlab $(MATLAB_BATCH_OPTIONS) run_test_matlab > $*.m.log 2>&1 || \ - printf ":test-result: FAIL\n:number-tests: 1\n:number-failed-tests: 1\n:list-of-failed-tests: $*.mod\n:elapsed-time: 0.0\n" > $*.m.trs +# The while loop is a workaround for this glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19329 + @while ! [ -f $*.m.trs ] || head -1 $*.m.log | egrep -q '^Inconsistency detected by ld.so'; \ + do \ + DYNARE_VERSION="$(PACKAGE_VERSION)" TOP_TEST_DIR="$(CURDIR)" FILESTEM="$*" \ + $(MATLAB)/bin/matlab $(MATLAB_BATCH_OPTIONS) run_test_matlab > $*.m.log 2>&1 || \ + printf ":test-result: FAIL\n:number-tests: 1\n:number-failed-tests: 1\n:list-of-failed-tests: $*.mod\n:elapsed-time: 0.0\n" > $*.m.trs; \ + done @if test -z "$(filter $*.m.trs,$(M_XFAIL_TRS_FILES))"; then pass_color=2; fail_color=1; else pass_color=1; fail_color=2; fi; \ if grep -q ":test-result: PASS" $*.m.trs; then \ echo "`tput bold``tput setaf $${pass_color}`MATLAB: $(CURDIR)/$* PASSED!`tput sgr0`" ; \ @@ -1244,8 +1248,13 @@ check-matlab-ols: $(M_OLS_TRS_FILES) %.m.trs %.m.log : %.m @echo "`tput bold``tput setaf 8`MATLAB: $(CURDIR)/$*... `tput sgr0`" - @DYNARE_VERSION="$(PACKAGE_VERSION)" TOP_TEST_DIR="$(CURDIR)" \ - $(MATLAB)/bin/matlab $(MATLAB_BATCH_OPTIONS) $* > $*.m.log 2>&1 +# The while loop is a workaround for this glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19329 + @while ! [ -f $*.m.trs ] || head -1 $*.m.log | egrep -q '^Inconsistency detected by ld.so'; \ + do \ + DYNARE_VERSION="$(PACKAGE_VERSION)" TOP_TEST_DIR="$(CURDIR)" \ + $(MATLAB)/bin/matlab $(MATLAB_BATCH_OPTIONS) $* > $*.m.log 2>&1 || \ + printf ":test-result: FAIL\n:number-tests: 1\n:number-failed-tests: 1\n:list-of-failed-tests: $*.mod\n:elapsed-time: 0.0\n" > $*.m.trs; \ + done @echo "`tput bold``tput setaf 8`MATLAB: $(CURDIR)/$* Done!`tput sgr0`" %.o.trs %.o.log: %.mod