@@ -409,12 +409,6 @@ def run(self) -> None:
409409 if self .args .worktree :
410410 self .worktree_mode ()
411411
412- if not self .args .replay_test and self .test_cfg .tests_root .exists ():
413- leftover_trace_files = list (self .test_cfg .tests_root .glob ("*.trace" ))
414- if leftover_trace_files :
415- logger .debug (f"Cleaning up { len (leftover_trace_files )} leftover trace file(s) from previous runs" )
416- cleanup_paths (leftover_trace_files )
417-
418412 cleanup_paths (Optimizer .find_leftover_instrumented_test_files (self .test_cfg .tests_root ))
419413
420414 function_optimizer = None
@@ -525,8 +519,6 @@ def run(self) -> None:
525519 )
526520 if self .functions_checkpoint :
527521 self .functions_checkpoint .cleanup ()
528- if hasattr (self .args , "command" ) and self .args .command == "optimize" :
529- self .cleanup_replay_tests ()
530522 if optimizations_found == 0 :
531523 logger .info ("❌ No optimizations found." )
532524 elif self .args .all :
@@ -562,17 +554,6 @@ def find_leftover_instrumented_test_files(test_root: Path) -> list[Path]:
562554 file_path for file_path in test_root .rglob ("*" ) if file_path .is_file () and pattern .match (file_path .name )
563555 ]
564556
565- def cleanup_replay_tests (self ) -> None :
566- paths_to_cleanup = []
567- if self .replay_tests_dir and self .replay_tests_dir .exists ():
568- logger .debug (f"Cleaning up replay tests directory: { self .replay_tests_dir } " )
569- paths_to_cleanup .append (self .replay_tests_dir )
570- if self .trace_file and self .trace_file .exists ():
571- logger .debug (f"Cleaning up trace file: { self .trace_file } " )
572- paths_to_cleanup .append (self .trace_file )
573- if paths_to_cleanup :
574- cleanup_paths (paths_to_cleanup )
575-
576557 def cleanup_temporary_paths (self ) -> None :
577558 if hasattr (get_run_tmp_file , "tmpdir" ):
578559 get_run_tmp_file .tmpdir .cleanup ()
@@ -584,14 +565,7 @@ def cleanup_temporary_paths(self) -> None:
584565
585566 if self .current_function_optimizer :
586567 self .current_function_optimizer .cleanup_generated_files ()
587- paths_to_cleanup = [self .test_cfg .concolic_test_root_dir , self .replay_tests_dir ]
588- if self .trace_file :
589- paths_to_cleanup .append (self .trace_file )
590- if self .test_cfg .tests_root .exists ():
591- for trace_file in self .test_cfg .tests_root .glob ("*.trace" ):
592- if trace_file not in paths_to_cleanup :
593- paths_to_cleanup .append (trace_file )
594- cleanup_paths (paths_to_cleanup )
568+ cleanup_paths ([self .test_cfg .concolic_test_root_dir ])
595569
596570 def worktree_mode (self ) -> None :
597571 if self .current_worktree :
0 commit comments