diff --git a/Makefile b/Makefile index 967393605..d4e89aedf 100644 --- a/Makefile +++ b/Makefile @@ -120,10 +120,10 @@ ldb_tests: all $(PROGRAMS) $(TOOLS) crash_test: blackbox_crash_test whitebox_crash_test blackbox_crash_test: db_stress - python tools/db_crashtest.py + python -u tools/db_crashtest.py whitebox_crash_test: db_stress - python tools/db_crashtest2.py + python -u tools/db_crashtest2.py valgrind_check: all $(PROGRAMS) $(TESTS) echo TESTS THAT HAVE VALGRIND ERRORS > $(VALGRIND_DIR)/valgrind_failed_tests; \ diff --git a/tools/db_crashtest2.py b/tools/db_crashtest2.py index d7842a1fa..ab7f8d717 100644 --- a/tools/db_crashtest2.py +++ b/tools/db_crashtest2.py @@ -111,12 +111,19 @@ def main(argv): expected = True if not expected: - print "TEST FAILED!!!\n" + print "TEST FAILED. See kill option and exit code above!!!\n" sys.exit(1) stdoutdata = stdoutdata.lower() - if ('error' in stdoutdata) or ('fail' in stdoutdata): - print "TEST FAILED!!!\n" + errorcount = (stdoutdata.count('error') - + stdoutdata.count('got errors 0 times')) + print "#times error occured in output is " + str(errorcount) + "\n" + + if (errorcount > 0): + print "TEST FAILED. Output has 'error'!!!\n" + sys.exit(2) + if (stdoutdata.find('fail') >= 0): + print "TEST FAILED. Output has 'fail'!!!\n" sys.exit(2) time.sleep(1) # time to stabilize after a kill