diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml index 9b31ac9d4a..6beba49a74 100644 --- a/.github/workflows/precommit.yml +++ b/.github/workflows/precommit.yml @@ -136,6 +136,10 @@ jobs: - python-version: "3.14" cloud-provider: gcp os: windows-latest-64-cores + # Cap pytest-xdist parallelism — Python 3.14 + Windows 64-core runners + # exhaust threads/memory at -n logical (MemoryError in pytest_timeout + # Timer.start, plus stack overflows in connector ThreadPoolExecutors). + tox-extra-factors: "-lowparallel" steps: - name: Checkout Code uses: actions/checkout@v4 @@ -189,12 +193,13 @@ jobs: # do not run other tests for macos - if: ${{ matrix.os != 'macos-latest' }} name: Run tests (excluding doctests) - run: python -m tox -e "py${PYTHON_VERSION/\./}-notdoctest-ci" + run: python -m tox -e "py${PYTHON_VERSION/\./}-notdoctest${EXTRA_TOX_FACTORS}-ci" env: PYTHON_VERSION: ${{ matrix.python-version }} cloud_provider: ${{ matrix.cloud-provider }} PYTEST_ADDOPTS: --color=yes --tb=short TOX_PARALLEL_NO_SPINNER: 1 + EXTRA_TOX_FACTORS: ${{ matrix.tox-extra-factors }} SNOWPARK_PYTHON_API_TEST_BUCKET_PATH: ${{ secrets.SNOWPARK_PYTHON_API_TEST_BUCKET_PATH }} SNOWPARK_PYTHON_API_S3_STORAGE_INTEGRATION: ${{ vars.SNOWPARK_PYTHON_API_S3_STORAGE_INTEGRATION }} shell: bash diff --git a/tox.ini b/tox.ini index fec74cd6a1..9b4ab73404 100644 --- a/tox.ini +++ b/tox.ini @@ -73,8 +73,12 @@ setenv = # For AST tests, use just 36 cores, because using more cores sometimes # causes the test job to fail with exit code 143, which supposedly means # that it uses too many machine resources. - !doctest-!ast: SNOWFLAKE_PYTEST_PARALLELISM = -n logical + !doctest-!ast-!lowparallel: SNOWFLAKE_PYTEST_PARALLELISM = -n logical ast: SNOWFLAKE_PYTEST_PARALLELISM = -n 36 + # Python 3.14 + Windows 64-core runners hit MemoryError in pytest_timeout's + # Timer.start() and thread-pool stack overflows when running 64 xdist workers, + # so cap parallelism the same way ast tests do. + lowparallel: SNOWFLAKE_PYTEST_PARALLELISM = -n 36 # Snowpark uses 4 workers for daily testing since some of its test jobs use weak MacOS instances. !doctest: SNOWFLAKE_PYTEST_DAILY_PARALLELISM = -n 6 # Set test type, either notset, unit, integ, or both