Skip to content

Commit 009b14f

Browse files
authored
[TorchTitan] Remove checkpoint folder at the end in test_runner.py (#225)
1 parent fd5ad5a commit 009b14f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test_runner.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
# Copyright (c) Meta Platforms, Inc. and affiliates.
55
# All rights reserved.
6+
import glob
67
import os
8+
import shutil
79
import subprocess
810
from collections import defaultdict
911
from dataclasses import dataclass
@@ -113,3 +115,9 @@ def run_test(test_flavor: OverrideDefinitions, full_path: str):
113115

114116
for test_flavor in test_flavors:
115117
run_test(test_flavor, full_path)
118+
119+
# Deleting checkpoint folder from test
120+
dir_list = glob.iglob(f"{test_checkpoint_dir}_*")
121+
for path in dir_list:
122+
if os.path.exists(path):
123+
shutil.rmtree(path)

0 commit comments

Comments
 (0)