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
main
Andrew Kryczka 6 years ago committed by Facebook Github Bot
parent c766887458
commit de2c6fb158
  1. 6
      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)

Loading…
Cancel
Save