-
Notifications
You must be signed in to change notification settings - Fork 154
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
[#1601] Convert datetime functionalities to java.time package #1625
[#1601] Convert datetime functionalities to java.time package #1625
Conversation
SimpleDateFormat is not thread-safe, resulting in tests occasionally failing when multi-threading. Let's use DateTimeFormatter since it is thread-safe.
Tests are failing likely as timezone used is changed. It should not be using the local timezone since I have no idea what timezone github actions runs on. Timezone logic should be based on config (#1360), else I believe timezone should be ignored. |
Is it possible to revert the changes to tests since tests do not run in parallel? |
Actually what's the reason why |
No, we have to test in parallel as well, otherwise we would not be able to catch concurrency-related issues that occur when users use the software.
The timezone uses the user's local timezone on the computer, so that it is something expected when the user runs the software on their computer. GitHub Actions uses UTC+0, unless otherwise specified in a particular test. This is not supposed to be an easy bug to fix, especially on the timezone issues. I'll do a proper review in a couple of days and provide some guidance on how to address the issue. |
The code that added the time zone parameter are in #1346. We use the user's computer time zone ( Git commit date and time will have the time zone attached to them. We want to convert them into an instant, so that we can compare them with the since and until date instants. Another tip, to test the time zone stuff, you can change the time zone on your local computer and run the program again to see if it works. GitHub Actions uses UTC+0 time zone. |
I'm converting this to draft since this may need more time to fix. |
Some boolean statements do not look intuitive. Let's add comments to explain their purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great job on this PR!
In the interest of moving this PR along, I will merge this directly. @fzdy1914 Do let me know if you have any additional comments on this PR. |
The following links are for previewing this pull request:
|
Fixes #1601
Proposed Commit Message: