diff --git a/ci/test/parallel_run.py b/ci/test/parallel_run.py index fbfa40b38ea..682171ce537 100644 --- a/ci/test/parallel_run.py +++ b/ci/test/parallel_run.py @@ -51,7 +51,7 @@ def available_slots(): os.environ, CUDA_VISIBLE_DEVICES=cuda_visible_devices, ONEFLOW_TEST_CTRL_PORT=str(find_free_port()), - ONEFLOW_TEST_LOG_DIR=("./unittest-log-" + str(uuid.uuid4())), + ONEFLOW_TEST_LOG_DIR=("./unittest-log/" + str(uuid.uuid4())), ), shell=True, ) diff --git a/oneflow/python/framework/unittest.py b/oneflow/python/framework/unittest.py index 3d31ac1390b..11d178c4fed 100644 --- a/oneflow/python/framework/unittest.py +++ b/oneflow/python/framework/unittest.py @@ -151,6 +151,10 @@ def setUp(self): atexit.register(oneflow.deprecated.delete_worker) _unittest_worker_initilized = True + log_dir = os.getenv("ONEFLOW_TEST_LOG_DIR") + if log_dir: + oneflow.env.log_dir(log_dir) + if _unittest_env_initilized == False: oneflow.env.init() _unittest_env_initilized = True @@ -158,9 +162,6 @@ def setUp(self): oneflow.clear_default_session() oneflow.enable_eager_execution(eager_execution_enabled()) oneflow.experimental.enable_typing_check(typing_check_enabled()) - log_dir = os.getenv("ONEFLOW_TEST_LOG_DIR") - if log_dir: - oneflow.env.log_dir(log_dir) def skip_unless(n, d):