Skip to content

Run leaking provider tests with providers changed after them in CI - #74123

Merged
shahar1 merged 1 commit into
apache:mainfrom
shahar1:selective-checks-test-side-effect-providers
Oct 3, 2026
Merged

shahar1 merged 1 commit into
apache:mainfrom
shahar1:selective-checks-test-side-effect-providers

Conversation

@shahar1

@shahar1 shahar1 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

related: #73832, #74122

This PR includes cncf.kubernetes tests in selective DB checks for providers that run after it, so checks catch shared-process state leaks like the edge3 canary failure.

AI Summary A PR that only changes a provider runs that provider's tests (plus direct dependents) in a pytest process of their own. On canary the same tests run inside the shared `Providers[-amazon,celery,google,standard]` process, after every provider that sorts before them. `cncf.kubernetes` tests `importlib.reload()` `airflow.executors.executor_loader` and leave its state behind (a replaced `ExecutorLoader` class object and a cached `KubernetesExecutor` name), so a test that mocks `ExecutorLoader` through the module path passes in its own PR and fails on every canary build afterwards. #73832 did exactly that with an edge3 test; #74122 fixes that test.

This makes selective checks reproduce the relevant part of the canary process composition:

  • PROVIDERS_WITH_PROCESS_GLOBAL_TEST_SIDE_EFFECTS (currently cncf.kubernetes) is added to the Providers[...] test type when a provider whose own files changed sorts after it. A change to providers/edge3/ now runs Providers[cncf.kubernetes,common.compat,edge3]; a change to providers/apache/beam/ or an API change pulling in fab stays as before.
  • Dependents pulled in only for coverage do not widen the selection, since a PR can make a provider's tests order-sensitive only by changing that provider.
  • The CI job description keeps naming the selected providers (common.compat,edge3, not cncf.kubernetes,common.compat).
  • Individually-listed test types are untouched, as each provider runs alone there.

Scope and cost: this covers DB tests, which run one process per test type in sorted folder order. Non-DB tests share one xdist pool across all test types, so there is no deterministic order to reproduce. 76 of the 104 shared-bucket providers sort after cncf.kubernetes, so most single-provider PRs gain the cncf.kubernetes suite (about 800 test functions) in the DB jobs and in each compat-matrix entry. A new leak introduced on the cncf.kubernetes side is not caught by this; the durable fix for that is replacing the reload() calls in cncf.kubernetes and celery tests with the clean_executor_loader fixture, which is a separate cleanup.

Evidence: running the full canary shared bucket DB tests from main locally in one process (2627 tests) fails exactly one test, the edge3 one. No other provider is currently affected, so the list stays at one entry.

Docs (dev/breeze/doc/ci/04_selective_checks.md) and test_selective_checks.py updated in the same change: 4 existing expectations widen, new parametrized tests cover the rule, the description stripping and the constant's validity.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5.1)

Generated-by: Claude Code (Fable 5.1) following the guidelines

A PR that only changes a provider runs that provider's tests, with its
direct dependents, in a pytest process of its own. On canary, the same
tests run inside the shared Providers[-amazon,celery,google,standard]
process, after every provider that sorts before them. cncf.kubernetes
tests reload airflow.executors.executor_loader and leave its state
behind, so a test that mocks ExecutorLoader through the module path can
pass in its PR and fail on every canary build and release-candidate
check afterwards. PR apache#73832 did exactly that with an edge3 test.

Selective checks now add the providers listed in
PROVIDERS_WITH_PROCESS_GLOBAL_TEST_SIDE_EFFECTS to the Providers[...]
test type whenever a provider whose own files changed sorts after them,
so the PR runs those tests in the order canary does. Dependents pulled
in only for coverage do not widen the selection, and the CI job
description keeps naming the selected providers.
@shahar1
shahar1 force-pushed the selective-checks-test-side-effect-providers branch from 03fd387 to d768beb Compare October 3, 2026 12:27
@shahar1
shahar1 merged commit 11d25a5 into apache:main Oct 3, 2026
36 checks passed
@shahar1
shahar1 deleted the selective-checks-test-side-effect-providers branch October 3, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants