Skip to content

test: make ensure_requirements tests deterministic#22789

Open
kumarUjjawal wants to merge 1 commit into
apache:mainfrom
kumarUjjawal:fix/flaky-test-requirements
Open

test: make ensure_requirements tests deterministic#22789
kumarUjjawal wants to merge 1 commit into
apache:mainfrom
kumarUjjawal:fix/flaky-test-requirements

Conversation

@kumarUjjawal
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

The ensure_requirements plan tests were using ConfigOptions::default().
That makes target_partitions depend on the machine CPU count.

Because of that, the same test could build a different physical plan on a
runner with more CPUs. In the failing case, EnsureRequirements added an
extra RepartitionExec, so the snapshot changed even though the optimizer was
doing the right thing.

What changes are included in this PR?

  • Add a small test-only config helper with a fixed target_partitions
  • Use that helper in the ensure_requirements test helpers and the tests in
    this module that directly build a config
  • Keep the plan snapshots and idempotency checks stable across machines with
    different CPU counts

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions github-actions Bot added the core Core DataFusion crate label Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI failing on main: test_filter_over_multi_partition_sort_limit is CPU-count dependent (RepartitionExec(32) vs 16 partitions)

1 participant