From 5098ff08ec1e3fd4e9643b1ee37043f0417750ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Sun, 28 Nov 2021 18:58:03 +0100 Subject: [PATCH] Tune Conda CI timeout and other minor improvements (#10769) --- .github/workflows/ci_test-base.yml | 1 - .github/workflows/ci_test-conda.yml | 8 ++++---- requirements/adjust_versions.py | 7 ++++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_test-base.yml b/.github/workflows/ci_test-base.yml index 8b2f8b721a37e..c2f1d370e2d1a 100644 --- a/.github/workflows/ci_test-base.yml +++ b/.github/workflows/ci_test-base.yml @@ -59,7 +59,6 @@ jobs: - name: Test Package [only] run: | - # NOTE: run coverage on tests does not propagate failure status for Win, https://github.com/nedbat/coveragepy/issues/1003 coverage run --source pytorch_lightning -m pytest pytorch_lightning -v --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml - name: Upload pytest test results diff --git a/.github/workflows/ci_test-conda.yml b/.github/workflows/ci_test-conda.yml index a24a15baf4d78..fa366e645f1d9 100644 --- a/.github/workflows/ci_test-conda.yml +++ b/.github/workflows/ci_test-conda.yml @@ -17,7 +17,7 @@ jobs: python-version: ["3.8"] # previous to last Python version as that one is already used in test-full pytorch-version: ["1.7", "1.8", "1.9", "1.10"] # nightly: add when there's a release candidate - timeout-minutes: 35 + timeout-minutes: 30 steps: - uses: actions/checkout@v2 @@ -29,7 +29,8 @@ jobs: python ./requirements/adjust_versions.py requirements/extra.txt python ./requirements/adjust_versions.py requirements/examples.txt pip install --requirement requirements/devel.txt --find-links https://download.pytorch.org/whl/nightly/torch_nightly.html - pip install pytest-random-order + # set a per-test timeout of 2.5 minutes to fail sooner. this aids with hanging tests + pip install pytest-timeout pip list - name: Pull checkpoints from S3 @@ -42,8 +43,7 @@ jobs: - name: Tests run: | - # NOTE: run coverage on tests does not propagate failure status for Win, https://github.com/nedbat/coveragepy/issues/1003 - coverage run --source pytorch_lightning -m pytest --random-order-seed=1 pytorch_lightning tests -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-torch${{ matrix.pytorch-version }}.xml + coverage run --source pytorch_lightning -m pytest --timeout 150 pytorch_lightning tests -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-torch${{ matrix.pytorch-version }}.xml shell: bash -l {0} - name: Upload pytest results diff --git a/requirements/adjust_versions.py b/requirements/adjust_versions.py index 8295a726e7873..2ec7a177e0824 100644 --- a/requirements/adjust_versions.py +++ b/requirements/adjust_versions.py @@ -83,8 +83,9 @@ def test(): else: requirements_path, torch_version = sys.argv[1], None - with open(requirements_path, "r+") as fp: + with open(requirements_path) as fp: requirements = fp.read() - requirements = main(requirements, torch_version) - print(requirements) # on purpose - to debug + requirements = main(requirements, torch_version) + print(requirements) # on purpose - to debug + with open(requirements_path, "w") as fp: fp.write(requirements)