Skip to content

[BUG] Fix flaky tests related to WeekOfYear in CalcitePPLDateTimeBuiltinFunctionIT #3815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025

Conversation

yuancu
Copy link
Contributor

@yuancu yuancu commented Jun 24, 2025

Description

This fixes flaky tests related to YEARWEEK function in certain locales.

This fix assumes that the existing implementation is correct, and only fixes tests.

The problem arises from

int weekNumber = calendar.get(Calendar.WEEK_OF_YEAR);

When locale is in ja-JP-u-ca-japanese-x-lvariant-JP, the calendar implementation is JapanImperialCalender. Retrieving week of the year with this calendar on 1984-04-12 results in 14; while in en-US locale it returns 15.

Related Issues

Resolves #3814

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@LantaoJin LantaoJin added flaky-test Flaky build or test issue calcite calcite migration releated backport 2.19-dev labels Jun 24, 2025
@penghuo penghuo merged commit 30f2508 into opensearch-project:main Jun 26, 2025
25 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jun 26, 2025
…IT (#3815)

Signed-off-by: Yuanchun Shen <[email protected]>
(cherry picked from commit 30f2508)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.19-dev calcite calcite migration releated flaky-test Flaky build or test issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Flaky test testYearWeek in certain locales
3 participants