Issue #2776071 by damiankloip: run-tests.sh does not return a non zero status when tests fail with exception (cherry picked from commit b026909e)