@@ -359,6 +359,19 @@ def process_self_contained_coordinator_stream(
359
359
resp_version = None ,
360
360
override_memtier_test_time = 0 ,
361
361
):
362
+ def delete_temporary_files (
363
+ temporary_dir_client , full_result_path , benchmark_tool_global
364
+ ):
365
+ if preserve_temporary_client_dirs is True :
366
+ logging .info (f"Preserving temporary client dir { temporary_dir_client } " )
367
+ else :
368
+ if "redis-benchmark" in benchmark_tool_global :
369
+ if full_result_path is not None :
370
+ os .remove (full_result_path )
371
+ logging .info ("Removing temporary JSON file" )
372
+ shutil .rmtree (temporary_dir_client , ignore_errors = True )
373
+ logging .info (f"Removing temporary client dir { temporary_dir_client } " )
374
+
362
375
overall_result = True
363
376
results_matrix = []
364
377
total_test_suite_runs = 0
@@ -507,6 +520,11 @@ def process_self_contained_coordinator_stream(
507
520
test_name , maxmemory , benchmark_required_memory
508
521
)
509
522
)
523
+ delete_temporary_files (
524
+ temporary_dir_client = temporary_dir_client ,
525
+ full_result_path = None ,
526
+ benchmark_tool_global = benchmark_tool_global ,
527
+ )
510
528
continue
511
529
512
530
reset_commandstats (redis_conns )
@@ -543,13 +561,23 @@ def process_self_contained_coordinator_stream(
543
561
test_name , priority_upper_limit , priority
544
562
)
545
563
)
564
+ delete_temporary_files (
565
+ temporary_dir_client = temporary_dir_client ,
566
+ full_result_path = None ,
567
+ benchmark_tool_global = benchmark_tool_global ,
568
+ )
546
569
continue
547
570
if priority < priority_lower_limit :
548
571
logging .warning (
549
572
"Skipping test {} giving the priority limit ({}) is bellow the priority value ({})" .format (
550
573
test_name , priority_lower_limit , priority
551
574
)
552
575
)
576
+ delete_temporary_files (
577
+ temporary_dir_client = temporary_dir_client ,
578
+ full_result_path = None ,
579
+ benchmark_tool_global = benchmark_tool_global ,
580
+ )
553
581
continue
554
582
logging .info (
555
583
"Test {} priority ({}) is within the priority limit [{},{}]" .format (
@@ -567,10 +595,20 @@ def process_self_contained_coordinator_stream(
567
595
test_name
568
596
)
569
597
)
598
+ delete_temporary_files (
599
+ temporary_dir_client = temporary_dir_client ,
600
+ full_result_path = None ,
601
+ benchmark_tool_global = benchmark_tool_global ,
602
+ )
570
603
continue
571
604
572
605
if dry_run is True :
573
606
dry_run_count = dry_run_count + 1
607
+ delete_temporary_files (
608
+ temporary_dir_client = temporary_dir_client ,
609
+ full_result_path = None ,
610
+ benchmark_tool_global = benchmark_tool_global ,
611
+ )
574
612
continue
575
613
576
614
if "preload_tool" in benchmark_config ["dbconfig" ]:
@@ -598,6 +636,11 @@ def process_self_contained_coordinator_stream(
598
636
logging .warning (
599
637
"Skipping this test given preload result was false"
600
638
)
639
+ delete_temporary_files (
640
+ temporary_dir_client = temporary_dir_client ,
641
+ full_result_path = None ,
642
+ benchmark_tool_global = benchmark_tool_global ,
643
+ )
601
644
continue
602
645
execute_init_commands (
603
646
benchmark_config , r , dbconfig_keyname = "dbconfig"
@@ -618,6 +661,11 @@ def process_self_contained_coordinator_stream(
618
661
619
662
if dry_run_include_preload is True :
620
663
dry_run_count = dry_run_count + 1
664
+ delete_temporary_files (
665
+ temporary_dir_client = temporary_dir_client ,
666
+ full_result_path = None ,
667
+ benchmark_tool_global = benchmark_tool_global ,
668
+ )
621
669
continue
622
670
623
671
benchmark_tool = extract_client_tool (benchmark_config )
@@ -692,6 +740,11 @@ def process_self_contained_coordinator_stream(
692
740
logging .warning (
693
741
"Forcing skip this test given there is an arbitrary commmand and memtier usage. Check https://github.com/RedisLabs/memtier_benchmark/pull/117 ."
694
742
)
743
+ delete_temporary_files (
744
+ temporary_dir_client = temporary_dir_client ,
745
+ full_result_path = None ,
746
+ benchmark_tool_global = benchmark_tool_global ,
747
+ )
695
748
continue
696
749
697
750
client_container_image = extract_client_container_image (
@@ -899,18 +952,11 @@ def process_self_contained_coordinator_stream(
899
952
shutil .copy (full_result_path , dest_fpath )
900
953
overall_result &= test_result
901
954
902
- if preserve_temporary_client_dirs is True :
903
- logging .info (
904
- f"Preserving temporary client dir { temporary_dir_client } "
905
- )
906
- else :
907
- if "redis-benchmark" in benchmark_tool_global :
908
- os .remove (full_result_path )
909
- logging .info ("Removing temporary JSON file" )
910
- shutil .rmtree (temporary_dir_client , ignore_errors = True )
911
- logging .info (
912
- f"Removing temporary client dir { temporary_dir_client } "
913
- )
955
+ delete_temporary_files (
956
+ temporary_dir_client = temporary_dir_client ,
957
+ full_result_path = full_result_path ,
958
+ benchmark_tool_global = benchmark_tool_global ,
959
+ )
914
960
915
961
table_name = "Results for entire test-suite"
916
962
results_matrix_headers = [
0 commit comments