From a6700d81ff28a48770af1501dfa7018736a408bd Mon Sep 17 00:00:00 2001 From: you-n-g Date: Wed, 6 Jul 2022 20:44:10 +0800 Subject: [PATCH] Update test_qlib_from_source_slow.yml's timeout setting. (#1178) * Update test_qlib_from_source_slow.yml * Update test_qlib_from_source.yml * Update test_pit.py * Update test_pit.py * Update test_pit.py * Update test_pit.py --- .github/workflows/test_qlib_from_source.yml | 13 +++++++++---- .github/workflows/test_qlib_from_source_slow.yml | 3 ++- tests/test_pit.py | 6 ++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test_qlib_from_source.yml b/.github/workflows/test_qlib_from_source.yml index f71cc800f..ffeb66483 100644 --- a/.github/workflows/test_qlib_from_source.yml +++ b/.github/workflows/test_qlib_from_source.yml @@ -8,7 +8,8 @@ on: jobs: build: - timeout-minutes: 120 + timeout-minutes: 180 + # we may retry for 3 times for `Unit tests with Pytest` runs-on: ${{ matrix.os }} strategy: @@ -145,6 +146,10 @@ jobs: python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml - name: Unit tests with Pytest - run: | - cd tests - python -m pytest . -m "not slow" --durations=0 + uses: nick-fields/retry@v2 + with: + timeout_minutes: 60 + max_attempts: 3 + command: | + cd tests + python -m pytest . -m "not slow" --durations=0 diff --git a/.github/workflows/test_qlib_from_source_slow.yml b/.github/workflows/test_qlib_from_source_slow.yml index e087ac7e2..d4b5cced7 100644 --- a/.github/workflows/test_qlib_from_source_slow.yml +++ b/.github/workflows/test_qlib_from_source_slow.yml @@ -8,7 +8,8 @@ on: jobs: build: - timeout-minutes: 120 + timeout-minutes: 360 + # we may retry for 3 times for `Unit tests with Pytest` runs-on: ${{ matrix.os }} strategy: diff --git a/tests/test_pit.py b/tests/test_pit.py index 1b1eaec89..329413ead 100644 --- a/tests/test_pit.py +++ b/tests/test_pit.py @@ -39,8 +39,10 @@ class TestPIT(unittest.TestCase): cn_data_dir = str(QLIB_DIR.joinpath("cn_data").resolve()) pit_dir = str(SOURCE_DIR.joinpath("pit").resolve()) pit_normalized_dir = str(SOURCE_DIR.joinpath("pit_normalized").resolve()) - GetData().qlib_data(name="qlib_data_simple", target_dir=cn_data_dir, region="cn") - GetData().qlib_data(name="qlib_data", target_dir=pit_dir, region="pit") + GetData().qlib_data( + name="qlib_data_simple", target_dir=cn_data_dir, region="cn", delete_old=False, exists_skip=True + ) + GetData().qlib_data(name="qlib_data", target_dir=pit_dir, region="pit", delete_old=False, exists_skip=True) # NOTE: This code does the same thing as line 43, but since baostock is not stable in downloading data, we have chosen to download offline data. # bs.login()