From 3bb944990672dfdaa435079e6a9ed21a47eb47f4 Mon Sep 17 00:00:00 2001 From: Vamsi Ponnekanti Date: Fri, 7 Jun 2013 11:06:20 -0700 Subject: [PATCH] [Fix whilebox crash test failure] Summary: I think the check for "error" that I added had caused false alarm. Fixed that. Test Plan: Revert Plan: OK Task ID: # Reviewers: emayanke, dhruba Reviewed By: emayanke Differential Revision: https://reviews.facebook.net/D11139 --- Makefile | 4 ++-- tools/db_crashtest2.py | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) 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