Skip to content

fix: gate debug-only assertions in physical planner test test_optimization_invariant_checker#23323

Merged
xudong963 merged 2 commits into
apache:mainfrom
buraksenn:fix-invariant-checker-release-nonlto
Jul 5, 2026
Merged

fix: gate debug-only assertions in physical planner test test_optimization_invariant_checker#23323
xudong963 merged 2 commits into
apache:mainfrom
buraksenn:fix-invariant-checker-release-nonlto

Conversation

@buraksenn

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

test_optimization_invariant_checker panics under release-nonlto profile which has debug_assertions=false. Thus, we need to gate

What changes are included in this PR?

Make sure debug_assertion required places are behind that gate

Are these changes tested?

Yes and this is test only change.

cargo test physical_planner --profile release-nonlto

now passes since we skip these checks as they are not supported in that profile

Are there any user-facing changes?

No

@github-actions github-actions Bot added the core Core DataFusion crate label Jul 4, 2026

@xudong963 xudong963 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about using cfg!(debug_assertions) which adds an explicit assert!(result.is_ok()) for release mode and removes the need to gate InvariantFailsExtensionNode, giving strictly better coverage with less #[cfg] surface.

@buraksenn

Copy link
Copy Markdown
Contributor Author

How about using cfg!(debug_assertions) which adds an explicit assert!(result.is_ok()) for release mode and removes the need to gate InvariantFailsExtensionNode, giving strictly better coverage with less #[cfg] surface.

Thanks, I did not think of this. I've applied it just now

@xudong963 xudong963 added this pull request to the merge queue Jul 5, 2026
Merged via the queue into apache:main with commit 6a0e76e Jul 5, 2026
35 checks passed
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.

physical_planner::tests::test_optimization_invariant_checker fails when run with release-nonlto profile

2 participants