Skip to content

CI Improvements for stability - #5908

Closed
ryanskeith wants to merge 5 commits into
conda:mainfrom
ryanskeith:fix/serial-test-configuration
Closed

CI Improvements for stability#5908
ryanskeith wants to merge 5 commits into
conda:mainfrom
ryanskeith:fix/serial-test-configuration

Conversation

@ryanskeith

@ryanskeith ryanskeith commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

Description

This PR seeks to reduce CI flakiness by fixing issue #5078 due to the fact that tests marked by serial were not running serially. This is done by using the py-test marker to run a slightly different pytest command. Also, marked a few more tests as serial during testing that were causing issues on parallel. Went more conservative thinking Stability > Speed.

Changes

  1. Fixed CI workflow (.github/workflows/tests.yml)
  • Serial tests now run without pytest-xdist (single process)
  • Parallel tests continue using -n auto
  • Cross-platform compatible using PYTEST_XDIST env var
  1. Marked 5 flaky tests as serial
  • test_subpackage_recipes - repodata cache locking
  • test_inner_python_loop_with_output - repodata cache locking
  • test_remove_workdir_default - package cache corruption
  • test_overlinking_detection - package cache corruption + tool crashes
  • test_conda_pkg_format - Windows file locking
  1. Suppressed deprecation warning (pyproject.toml)
  • Ignore CONDA_PACKAGE_EXTENSIONS warning from conda

Impact

  • ✅ Serial tests now actually run serially
  • ✅ Expected significant improvement in CI stability
  • ⚠️ Some tests run slower (no parallelism) but reliably (hopefully)

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@github-project-automation github-project-automation Bot moved this to 🆕 New in 🔎 Review Jan 30, 2026
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jan 30, 2026
@codspeed-hq

codspeed-hq Bot commented Jan 30, 2026

Copy link
Copy Markdown

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing ryanskeith:fix/serial-test-configuration (401f654) with main (0ade301)

Summary

✅ 5 untouched benchmarks

@ryanskeith ryanskeith linked an issue Jan 30, 2026 that may be closed by this pull request
2 tasks
@ryanskeith
ryanskeith marked this pull request as ready for review January 30, 2026 21:31
@ryanskeith
ryanskeith requested a review from a team as a code owner January 30, 2026 21:31
@dholth
dholth self-requested a review January 30, 2026 21:34
@ryanskeith ryanskeith changed the title CI Improvements CI Improvements for stability Jan 30, 2026
CONDA_CHANNEL_LABEL: ${{ matrix.conda-version == 'canary' && 'conda-canary/label/dev::' || '' }}
CONDA_VERSION: ${{ contains('canary|release', matrix.conda-version) && 'conda' || format('conda={0}', matrix.conda-version) }}
PYTEST_MARKER: ${{ matrix.test-type == 'serial' && 'serial' || 'not serial' }}
# Serial tests run without xdist (-n auto) to avoid race conditions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Serial tests run without xdist (-n auto) to avoid race conditions
# Serial tests run without xdist worker processes (-n auto) to avoid race conditions

Is there a higher-level place that a non-repeated env can go?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly, it cannot. Matrix.test-type is on the job level.

@beckermr beckermr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a strong -1 on this PR. My understanding of the original issue is that changes were made so that things that had been marked as serial no longer needed to be serial. Further the conda-build tests run fine after a few retries.

OTOH this pr is producing CI times in excess of 1.5 hours and the CI is still failing.

We need to go through each test and determine how it needs to be run, removing serial markers as much as possible. Then we can merge this PR for the remaining tests that actually need to be serial.

@github-project-automation github-project-automation Bot moved this from 🆕 New to 🏗️ In Progress in 🔎 Review Jan 30, 2026
@beckermr

Copy link
Copy Markdown
Contributor

Indeed see the original issue text:

I did not change/fix that in the recent pull requests (since tests run somewhat fine and otherwise it's a waste of resources).
We actually should run most of those tests in parallel since the reasons they were marked as serial are most likely connected to reasons handled by the pull requests above.

@ryanskeith

ryanskeith commented Jan 31, 2026

Copy link
Copy Markdown
Contributor Author

I feel that the code has a few issues with running in parallel. Thus moving the ones necessary to really run in serial will overall provide less restarts and thus saved time. There currently is a high chance of having to restart jobs due to parallelization. I would love to be able to run in parallel as well but I think we actually save time if we don't have to restart jobs.

Note that the serial jobs have not failed, they are only the parallel ones. I also think we could move some of the bigger tests to another nightly thread so we don't have to build pytorch every single push BUT this PR was about reducing run failures.

I think we should seek stability over speed. The claim here is restarting a failed jobs over and over again costs more than waiting for it to pass when run serially.

@jezdez

jezdez commented Feb 2, 2026

Copy link
Copy Markdown
Member

There is also #5904, could we combine these PRs so they get merged at some point?

@beckermr

beckermr commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

We won't see real improvements here unless we spend the effort to understand the code and why things break. If we don't have time, that's fine, we can move on to other things. If we are going to put effort in, let's spend it on fixing bugs and understanding the code.

@beckermr

beckermr commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

@jezdez I suggest we work on and merge your PR #5904 before this one. Effort on that PR will help make further debugging of flaky testing failures faster.

@ryanskeith ryanskeith closed this May 18, 2026
@github-project-automation github-project-automation Bot moved this from 🏗️ In Progress to 🏁 Done in 🔎 Review May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Remaining CI test concurrency basic issues

5 participants