Skip to content

Commit 0d446eb

Browse files
committed
added another flushall for the general exception handler
1 parent 00a242a commit 0d446eb

File tree

1 file changed

+9
-0
lines changed
  • redis_benchmarks_specification/__runner__

1 file changed

+9
-0
lines changed

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3022,6 +3022,15 @@ def delete_temporary_files(
30223022
print("-" * 60)
30233023
test_result = False
30243024

3025+
# Clean up database after exception to prevent contamination of next test
3026+
if args.flushall_on_every_test_end or args.flushall_on_every_test_start:
3027+
logging.warning("Exception caught - cleaning up database with FLUSHALL")
3028+
try:
3029+
for r in redis_conns:
3030+
r.flushall()
3031+
except Exception as e:
3032+
logging.error(f"FLUSHALL failed after exception: {e}")
3033+
30253034
# Check if user requested exit via Ctrl+C
30263035
if _exit_requested:
30273036
logging.info(

0 commit comments

Comments
 (0)