Skip to content

test(integ-test): isolate invalid datetime evaluation from scans - #5745

Open
mengweieric wants to merge 1 commit into
opensearch-project:mainfrom
mengweieric:menwe/invalid-datetime-makeresults
Open

test(integ-test): isolate invalid datetime evaluation from scans#5745
mengweieric wants to merge 1 commit into
opensearch-project:mainfrom
mengweieric:menwe/invalid-datetime-makeresults

Conversation

@mengweieric

Copy link
Copy Markdown
Collaborator

Description

CalcitePPLBuiltinDatetimeFunctionInvalidIT verifies that invalid datetime literals fail at runtime with the expected exception class and message. The class contains 146 assertions, but none of its queries reference an indexed field. The existing one-document index is used only to produce a row for expression evaluation.

Scanning that index also brings shard and point-in-time lifecycle behavior into tests whose goal is limited to function validation. With multiple shards, repeated failing scans can exhaust the PIT context limit before the remaining datetime assertions run.

This change uses makeresults count=1 as the common source for every query. It still produces one row and evaluates the same invalid literals at runtime, while removing the unrelated index scan. The four fixture loads are no longer needed and are removed.

All exception types and message assertions remain unchanged. This is a test-only scope correction; it does not change production behavior or address the separate PIT cleanup path.

Validation

  • Direct Calcite path: 45/45 methods pass
  • No-pushdown suite: 45/45 methods pass
  • All 146 assertions use makeresults count=1
  • No indexed source or loadIndex call remains in the class
  • Mutation check: changing the source to makeresults count=0 makes testYearInvalid fail in both modes because no row evaluates the expression
  • spotlessJavaCheck, compileTestJava, and git diff --check pass

The large line-count diff is mechanical: the same source substitution is applied to all 146 assertions, and Spotless collapses the now-shorter String.format expressions.

Related Issues

None.

Check List

  • New functionality includes testing.
  • Commits are signed per the DCO using --signoff or -s.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

CalcitePPLBuiltinDatetimeFunctionInvalidIT verifies that invalid datetime
literals fail at runtime with the expected exception class and message. Its
queries do not reference indexed fields, but each one currently scans a
one-document index solely to trigger expression evaluation.

Use `makeresults count=1` as the common source instead. This still produces
one runtime row and preserves all 146 invalid-function assertions, while
removing unrelated index, shard, and point-in-time lifecycle behavior from
the test class. Remove the fixture loads that are no longer used.

The separate Calcite PIT cleanup gap remains a production concern and is
not addressed by this test-only change.

Signed-off-by: Eric Wei <[email protected]>
@mengweieric mengweieric added the testing Related to improving software testing label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@dai-chen dai-chen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

just curious why PIT was triggered by each test in this IT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to improving software testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants