Skip to content

Commit

Permalink
Do not download slow test when on sandcastle (#57953)
Browse files Browse the repository at this point in the history
Summary:
Downloading slow_test list on SC causes timeout, this is even a bigger issue since `common_utils.py` is reused in many internal projects/modules.

Pull Request resolved: #57953

Test Plan: CI

Reviewed By: janeyx99

Differential Revision: D28325527

fbshipit-source-id: ae47c9e43ad6f416008005bb26ceb2f3d6966f2e
  • Loading branch information
Rong Rong (AI Infra) authored and facebook-github-bot committed May 10, 2021
1 parent 710a83d commit 2975333
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions torch/testing/_internal/common_utils.py
Expand Up @@ -856,8 +856,11 @@ def is_cached_file_valid():
def check_slow_test_from_stats(test):
global slow_tests_dict
if slow_tests_dict is None:
url = "https://raw.githubusercontent.com/pytorch/test-infra/master/stats/slow-tests.json"
slow_tests_dict = fetch_and_cache(".pytorch-slow-tests", url)
if not IS_SANDCASTLE and os.getenv("PYTORCH_RUN_DISABLED_TESTS", "0") != "1":
url = "https://raw.githubusercontent.com/pytorch/test-infra/master/stats/slow-tests.json"
slow_tests_dict = fetch_and_cache(".pytorch-slow-tests", url)
else:
slow_tests_dict = {}
test_suite = str(test.__class__).split('\'')[1]
test_name = f'{test._testMethodName} ({test_suite})'

Expand Down

0 comments on commit 2975333

Please sign in to comment.