Chukwa
  1. Chukwa
  2. CHUKWA-638

Daylight saving time causes TestChukwaWriters unit test to fail

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.6.0
    • Fix Version/s: 0.6.0
    • Component/s: Build and Test Code
    • Labels:
      None
    • Environment:

      Java, UTC time

      Description

      When timezone is set to UTC, the test case fails with this stacktrace:

      junit.framework.AssertionFailedError: Exception in TestChukwaWriters - testFixedIntervalOffsetCalculation(),Incorrect value for delay
      at junit.framework.Assert.fail(Assert.java:50)
      at org.apache.hadoop.chukwa.datacollection.writer.TestChukwaWriters.testFixedIntervalOffsetCalculation(TestChukwaWriters.java:441)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at junit.framework.TestCase.runTest(TestCase.java:168)
      at junit.framework.TestCase.runBare(TestCase.java:134)
      at junit.framework.TestResult$1.protect(TestResult.java:110)
      at junit.framework.TestResult.runProtected(TestResult.java:128)
      at junit.framework.TestResult.run(TestResult.java:113)
      at junit.framework.TestCase.run(TestCase.java:124)
      at junit.framework.TestSuite.runTest(TestSuite.java:243)
      at junit.framework.TestSuite.run(TestSuite.java:238)
      at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
      at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
      at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
      at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:81)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)

      The expected timestamp were hardcoded with daylight saving time on. The delay value is calculated to be 1 hour
      instead of 0.

      1. CHUKWA-638.patch
        6 kB
        Eric Yang
      2. CHUKWA-638-1.patch
        7 kB
        Eric Yang

        Activity

        Hide
        Eric Yang added a comment -

        Fixed hard coded epoch seconds.

        Show
        Eric Yang added a comment - Fixed hard coded epoch seconds.
        Hide
        Eric Yang added a comment -

        I just committed this.

        Show
        Eric Yang added a comment - I just committed this.
        Hide
        Hudson added a comment -

        Integrated in Chukwa-trunk #436 (See https://builds.apache.org/job/Chukwa-trunk/436/)
        CHUKWA-638. Fixed timezone offset in test case. (Eric Yang) (Revision 1305002)

        Result = FAILURE
        eyang : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1305002
        Files :

        • /incubator/chukwa/trunk/CHANGES.txt
        • /incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/datacollection/writer/TestChukwaWriters.java
        Show
        Hudson added a comment - Integrated in Chukwa-trunk #436 (See https://builds.apache.org/job/Chukwa-trunk/436/ ) CHUKWA-638 . Fixed timezone offset in test case. (Eric Yang) (Revision 1305002) Result = FAILURE eyang : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1305002 Files : /incubator/chukwa/trunk/CHANGES.txt /incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/datacollection/writer/TestChukwaWriters.java
        Hide
        Eric Yang added a comment -

        Still not fixed. SimpleDateFormat should pass in UTC timezone to prevent timezone offset change.

        Show
        Eric Yang added a comment - Still not fixed. SimpleDateFormat should pass in UTC timezone to prevent timezone offset change.
        Hide
        Eric Yang added a comment -

        Updated timezone to UTC

        Show
        Eric Yang added a comment - Updated timezone to UTC
        Hide
        Eric Yang added a comment -

        I just committed this.

        Show
        Eric Yang added a comment - I just committed this.
        Hide
        Hudson added a comment -

        Integrated in Chukwa-trunk #437 (See https://builds.apache.org/job/Chukwa-trunk/437/)
        CHUKWA-638. Fixed timezone offset in test case. (Eric Yang) (Revision 1305006)

        Result = FAILURE
        eyang : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1305006
        Files :

        • /incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/datacollection/writer/TestChukwaWriters.java
        Show
        Hudson added a comment - Integrated in Chukwa-trunk #437 (See https://builds.apache.org/job/Chukwa-trunk/437/ ) CHUKWA-638 . Fixed timezone offset in test case. (Eric Yang) (Revision 1305006) Result = FAILURE eyang : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1305006 Files : /incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/datacollection/writer/TestChukwaWriters.java

          People

          • Assignee:
            Eric Yang
            Reporter:
            Eric Yang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development