Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/src/test/scala/org/apache/spark/SparkFunSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ abstract class SparkFunSuite
with Logging {
// scalastyle:on

// Initialize the logger forcibly to let the logger log timestamp
// 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
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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


// Timezone is fixed to America/Los_Angeles for those timezone sensitive tests (timestamp_*)
TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"))
// Add Locale setting
Expand Down