mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "CI sanity check test for env vars (#120519)"
This reverts commit f43b9c56c598b3a0f4d8e1d85f1e67b8f273d235.
Reverted https://github.com/pytorch/pytorch/pull/120519 on behalf of https://github.com/clee2000 due to broken on slow d27509c384 https://github.com/pytorch/pytorch/actions/runs/8208843198/job/22453617568 ([comment](https://github.com/pytorch/pytorch/pull/120519#issuecomment-1986480624))
This commit is contained in:
@ -2,7 +2,6 @@
|
||||
|
||||
import argparse
|
||||
import copy
|
||||
import glob
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
@ -382,7 +381,6 @@ def run_test(
|
||||
launcher_cmd=None,
|
||||
extra_unittest_args=None,
|
||||
env=None,
|
||||
print_log=True,
|
||||
) -> int:
|
||||
env = env or os.environ.copy()
|
||||
maybe_set_hip_visible_devies()
|
||||
@ -544,7 +542,7 @@ def run_test(
|
||||
# comes up in the future.
|
||||
ret_code = 0 if ret_code == 5 or ret_code == 4 else ret_code
|
||||
|
||||
if options.pipe_logs and print_log:
|
||||
if options.pipe_logs:
|
||||
handle_log_file(
|
||||
test_module, log_path, failed=(ret_code != 0), was_rerun=was_rerun
|
||||
)
|
||||
@ -1004,23 +1002,6 @@ def get_pytest_args(options, is_cpp_test=False, is_distributed_test=False):
|
||||
return pytest_args
|
||||
|
||||
|
||||
def run_ci_sanity_check(test: ShardedTest, test_directory, options):
|
||||
assert (
|
||||
test.name == "test_ci_sanity_check_fail"
|
||||
), f"This handler only works for test_ci_sanity_check_fail, got {test.name}"
|
||||
ret_code = run_test(test, test_directory, options, print_log=False)
|
||||
# This test should fail
|
||||
if ret_code != 1:
|
||||
return 1
|
||||
test_reports_dir = str(REPO_ROOT / "test/test-reports")
|
||||
# Delete the log files and xmls generated by the test
|
||||
for file in glob.glob(f"{test_reports_dir}/{test.name}*.log"):
|
||||
os.remove(file)
|
||||
for dirname in glob.glob(f"{test_reports_dir}/**/{test.name}"):
|
||||
shutil.rmtree(dirname)
|
||||
return 0
|
||||
|
||||
|
||||
CUSTOM_HANDLERS = {
|
||||
"test_cuda_primary_ctx": run_test_with_subprocess,
|
||||
"test_cuda_nvml_based_avail": run_test_with_subprocess,
|
||||
@ -1043,7 +1024,6 @@ CUSTOM_HANDLERS = {
|
||||
"distributed/rpc/test_share_memory": run_test_with_subprocess,
|
||||
"distributed/rpc/cuda/test_tensorpipe_agent": run_test_with_subprocess,
|
||||
"doctests": run_doctests,
|
||||
"test_ci_sanity_check_fail": run_ci_sanity_check,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user