-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32538][CORE][TEST] Use local time zone for the timestamp logged in unit-tests.log #29356
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
Conversation
|
Test build #127090 has finished for PR 29356 at commit
|
| // based on the local time zone depending on environments. | ||
| // The default time zone will be set to America/Los_Angeles later | ||
| // so this initialization is necessary here. | ||
| log |
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.
hm, TimeZone.setDefault below doesn't an affect the already-instanciated logger?
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.
Seems so. DateFormat classes used in log4j uses Calendar, which is instantiated in the constructor with the default time zone at the time.
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.
okay, if so, the change looks reasonable. cc: @srowen
…d in unit-tests.log ### What changes were proposed in this pull request? This PR lets the logger log timestamp based on local time zone during test. `SparkFunSuite` fixes the default time zone to America/Los_Angeles so the timestamp logged in unit-tests.log is also based on the fixed time zone. ### Why are the changes needed? It's confusable for developers whose time zone is not America/Los_Angeles. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Run existing tests and confirmed uint-tests.log. If your local time zone is America/Los_Angeles, you can test by setting the environment variable `TZ` like as follows. ``` $ TZ=Asia/Tokyo build/sbt "testOnly org.apache.spark.executor.ExecutorSuite" $ tail core/target/unit-tests.log ``` Closes #29356 from sarutak/fix-unit-test-log-timezone. Authored-by: Kousuke Saruta <[email protected]> Signed-off-by: Takeshi Yamamuro <[email protected]> (cherry picked from commit 4e267f3) Signed-off-by: Takeshi Yamamuro <[email protected]>
|
Thanks! Merged to master/branch-3.0. (NOTE: I manually checked this change could fix the issue) |
What changes were proposed in this pull request?
This PR lets the logger log timestamp based on local time zone during test.
SparkFunSuitefixes the default time zone to America/Los_Angeles so the timestamp logged in unit-tests.log is also based on the fixed time zone.Why are the changes needed?
It's confusable for developers whose time zone is not America/Los_Angeles.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Run existing tests and confirmed uint-tests.log.
If your local time zone is America/Los_Angeles, you can test by setting the environment variable
TZlike as follows.