Skip to content
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

KAFKA-18585 Fix fail test ValuesTest#shouldConvertDateValues #18611

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

m1a2st
Copy link
Contributor

@m1a2st m1a2st commented Jan 18, 2025

Jira: https://issues.apache.org/jira/browse/KAFKA-18585

The test scenario involves inputting dates in ISO8601 format yyyy-MM-dd. At this point, the time information is already lost. Then in the Values#convertToDate method, the date conversion is performed using string manipulation, without any timezone information being provided. Therefore, it's expected and normal behavior that the time gets converted to 00:00:00.

The solution is to explicitly convert Java Date objects, which internally store UTC timestamps, to UTC+0 timezone

before:
CleanShot 2025-01-19 at 00 13 28@2x
after:
CleanShot 2025-01-19 at 00 14 17@2x

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@github-actions github-actions bot added triage PRs from the community connect tests Test fixes (including flaky tests) small Small PRs labels Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connect small Small PRs tests Test fixes (including flaky tests) triage PRs from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant