diff --git a/.github/workflows/run-dep-tests.yml b/.github/workflows/run-dep-tests.yml index 445139467b81..8eb4cd0b5580 100644 --- a/.github/workflows/run-dep-tests.yml +++ b/.github/workflows/run-dep-tests.yml @@ -19,9 +19,9 @@ jobs: os: [ubuntu-latest, macOS-latest, windows-latest] steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e883041e4935..27c05a9d9110 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -20,9 +20,9 @@ jobs: os: [ubuntu-latest, macOS-latest, windows-latest] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/source-dist-tests.yml b/.github/workflows/source-dist-tests.yml index 6f8784caf948..3b6d39117caa 100644 --- a/.github/workflows/source-dist-tests.yml +++ b/.github/workflows/source-dist-tests.yml @@ -19,9 +19,9 @@ jobs: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] os: [ubuntu-latest, macOS-latest, windows-latest] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/update-lockfiles.yml b/.github/workflows/update-lockfiles.yml index bac84867b0b6..3b2cdc12491e 100644 --- a/.github/workflows/update-lockfiles.yml +++ b/.github/workflows/update-lockfiles.yml @@ -34,11 +34,11 @@ jobs: os: [macOS-latest, windows-latest] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: ref: ${{ github.event.inputs.ref }} - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: python-version: ${{ matrix.python-version }} diff --git a/scripts/ci/run-tests b/scripts/ci/run-tests index 4c4676f586c3..4afb287f8878 100755 --- a/scripts/ci/run-tests +++ b/scripts/ci/run-tests @@ -52,7 +52,17 @@ def process_args(args): test_args += f'--junit-xml={args.junit_xml_path} ' if args.markers: test_args += f'-m {args.markers} ' - test_args += '--numprocesses=auto --dist=loadfile --maxprocesses=4 ' + if os.getenv('PYTEST_XDIST_AUTO_NUM_WORKERS'): + # If the user set PYTEST_XDIST_AUTO_NUM_WORKERS, + # use that to limit max processes + max_processes = int(os.environ['PYTEST_XDIST_AUTO_NUM_WORKERS']) + elif os.getenv('GITHUB_ACTIONS', 'false') == 'true': + # Limiting parallelism in GitHub, to avoid the + # 'Error: The operation was canceled.' issues in 2026 + max_processes=3 + else: + max_processes=4 + test_args += f'--numprocesses=auto --dist=loadfile --maxprocesses={max_processes} ' dirs = " ".join(args.test_dirs) return runner, test_args, dirs