Github user scwf commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6377#discussion_r30943635
  
    --- Diff: 
core/src/test/scala/org/apache/spark/status/api/v1/SimpleDateParamTest.scala ---
    @@ -21,6 +21,11 @@ import org.scalatest.{Matchers, FunSuite}
     class SimpleDateParamTest extends FunSuite with Matchers {
     
       test("date parsing") {
    +    import java.util.{Locale, TimeZone}
    --- End diff --
    
    > I'm slightly afraid this will have negative effects on other tests since 
you're setting the defaults globally for the JVM.
    
    seems in spark all the date related tests use America/Los_Angeles time 
zone, so i think it will be ok.
    
    > Why would this fail though if the date parameter specifies its time zone? 
it should not be ambiguous.
    
    I also do not get the root cause. but actually it is time zone sensitive, 
we can have a simple test for this, after we specify the timezone other than 
"America/Los_Angeles", this test will fail:
    ```
    // Timezone is fixed to America/Los_Angeles for those timezone sensitive 
tests (timestamp_*)
          TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"))
          // Add Locale setting
          Locale.setDefault(Locale.US)
         new SimpleDateParam("2015-02-20T23:21:17.190GMT").timestamp should be 
(1424474477190L)
         new SimpleDateParam("2015-02-20T17:21:17.190CST").timestamp should be 
(1424474477190L)
         new SimpleDateParam("2015-02-20").timestamp should be (1424390400000L) 
 // GMT
    ```
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to