From 00a242ae2dca63c397afd1f82c60819f121594f7 Mon Sep 17 00:00:00 2001 From: Martin Dimitrov Date: Wed, 15 Oct 2025 13:35:01 -0700 Subject: [PATCH 1/2] adding flushall after memtier benchmark failure. Otherwise the database may be in a corrupted state for the next test --- redis_benchmarks_specification/__runner__/runner.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/redis_benchmarks_specification/__runner__/runner.py b/redis_benchmarks_specification/__runner__/runner.py index a9f44f8..42613cd 100644 --- a/redis_benchmarks_specification/__runner__/runner.py +++ b/redis_benchmarks_specification/__runner__/runner.py @@ -2671,6 +2671,14 @@ def delete_temporary_files( if not success: logging.error(f"Memtier benchmark failed: {stderr}") + # Clean up database after failure (timeout or error) + if args.flushall_on_every_test_end or args.flushall_on_every_test_start: + logging.warning("Benchmark failed - cleaning up database with FLUSHALL") + try: + for r in redis_conns: + r.flushall() + except Exception as e: + logging.error(f"FLUSHALL failed after benchmark failure: {e}") # Continue with the test but log the failure client_container_stdout = f"ERROR: {stderr}" From 0d446eb1ece2fa238e1715767a6ce3f89b2b9231 Mon Sep 17 00:00:00 2001 From: Martin Dimitrov Date: Wed, 15 Oct 2025 13:42:28 -0700 Subject: [PATCH 2/2] added another flushall for the general exception handler --- redis_benchmarks_specification/__runner__/runner.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/redis_benchmarks_specification/__runner__/runner.py b/redis_benchmarks_specification/__runner__/runner.py index 42613cd..78e432d 100644 --- a/redis_benchmarks_specification/__runner__/runner.py +++ b/redis_benchmarks_specification/__runner__/runner.py @@ -3022,6 +3022,15 @@ def delete_temporary_files( print("-" * 60) test_result = False + # Clean up database after exception to prevent contamination of next test + if args.flushall_on_every_test_end or args.flushall_on_every_test_start: + logging.warning("Exception caught - cleaning up database with FLUSHALL") + try: + for r in redis_conns: + r.flushall() + except Exception as e: + logging.error(f"FLUSHALL failed after exception: {e}") + # Check if user requested exit via Ctrl+C if _exit_requested: logging.info(