From de2c6fb1580ec48591179bc07e8b6f46588a2453 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Mon, 18 Jun 2018 17:42:48 -0700 Subject: [PATCH] Fix stderr processing in crash test (#4006) Summary: Fixed bug where `db_stress` output a line with a warning followed by a line with an error, and `db_crashtest.py` considered that a success. For example: ``` WARNING: prefix_size is non-zero but memtablerep != prefix_hash open error: Corruption: SST file is ahead of WALs ``` Closes https://github.com/facebook/rocksdb/pull/4006 Differential Revision: D8473463 Pulled By: ajkr fbshipit-source-id: 60461bdd7491d9d26c63f7d4ee522a0f88ba3de7 --- tools/db_crashtest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/db_crashtest.py b/tools/db_crashtest.py index 063a3ce9f..1531806e5 100644 --- a/tools/db_crashtest.py +++ b/tools/db_crashtest.py @@ -206,12 +206,12 @@ def blackbox_crash_main(args, unknown_args): while True: line = child.stderr.readline().strip() - if line != '' and not line.startswith('WARNING'): + if line == '': + break + elif not line.startswith('WARNING'): run_had_errors = True print('stderr has error message:') print('***' + line + '***') - else: - break if run_had_errors: sys.exit(2)