Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2145

Avatica tests fail depending on local timezone

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • avatica-1.10.0
    • 1.11.0
    • avatica
    • None

    Description

      Running the tests runs correctly with timezone forced to UTC, but fail with other timezones (verified with GMT+8 and GMT+2).

      All methods using default locale (e.g.,  Locale.getDefault()) or timezone (e.g., TimeZone.getDefault()) should have been forbidden (CALCITE-1167).

      For instance, this command works:

      MAVEN_OPTS="$MAVEN_OPTS -Duser.timezone=UTC" mvn clean test

      This other command fails:

      MAVEN_OPTS="$MAVEN_OPTS -Duser.timezone=GMT+8" mvn clean test

      In what follows the relevant extract from console when running mvn test.

      mvn clean test console output extract

      [...]

      2018-01-22 01:56:02,633 [main] INFO - Creating table BATCH_EXECUTE_33
      2018-01-22 01:56:02,635 [main] INFO - Creating table BATCH_EXECUTE_34
      2018-01-22 01:56:02,675 [main] INFO - Creating table BATCH_CLEARS_36
      2018-01-22 01:56:02,676 [main] INFO - Creating table BATCH_CLEARS_37
      Tests run: 78, Failures: 2, Errors: 0, Skipped: 4, Time elapsed: 0.569 sec <<< FAILURE! - in org.apache.calcite.avatica.RemoteDriverTest
      testBatchInsertWithDates[JSON](org.apache.calcite.avatica.RemoteDriverTest) Time elapsed: 0.013 sec <<< FAILURE!
      java.lang.AssertionError: Wrong day for row 0 expected:<21> but was:<20>
      at org.apache.calcite.avatica.RemoteDriverTest.executeBatchInsertWithDates(RemoteDriverTest.java:1444)
      at org.apache.calcite.avatica.RemoteDriverTest.access$1100(RemoteDriverTest.java:91)
      at org.apache.calcite.avatica.RemoteDriverTest.eachConnection(RemoteDriverTest.java:228)
      at org.apache.calcite.avatica.RemoteDriverTest.testBatchInsertWithDates(RemoteDriverTest.java:1379)

      testBatchInsertWithDates[PROTOBUF](org.apache.calcite.avatica.RemoteDriverTest) Time elapsed: 0.003 sec <<< FAILURE!
      java.lang.AssertionError: Wrong day for row 0 expected:<21> but was:<20>
      at org.apache.calcite.avatica.RemoteDriverTest.executeBatchInsertWithDates(RemoteDriverTest.java:1444)
      at org.apache.calcite.avatica.RemoteDriverTest.access$1100(RemoteDriverTest.java:91)
      at org.apache.calcite.avatica.RemoteDriverTest.eachConnection(RemoteDriverTest.java:228)
      at org.apache.calcite.avatica.RemoteDriverTest.testBatchInsertWithDates(RemoteDriverTest.java:1379)

      [...]

      Results :

      Failed tests:
      RemoteDriverTest.testBatchInsertWithDates:1379->eachConnection:228->access$1100:91->executeBatchInsertWithDates:1444 Wrong day for row 0 expected:<21> but was:<20>
      RemoteDriverTest.testBatchInsertWithDates:1379->eachConnection:228->access$1100:91->executeBatchInsertWithDates:1444 Wrong day for row 0 expected:<21> but was:<20>

      Tests run: 219, Failures: 2, Errors: 0, Skipped: 15

      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Summary:
      [INFO]
      [INFO] Apache Calcite Avatica Project ..................... SUCCESS [ 2.233 s]
      [INFO] Apache Calcite Avatica Metrics ..................... SUCCESS [ 2.984 s]
      [INFO] Apache Calcite Avatica ............................. SUCCESS [ 26.595 s]
      [INFO] Apache Calcite Avatica Server ...................... FAILURE [ 13.671 s]
      [INFO] Apache Calcite Avatica Standalone Server ........... SKIPPED
      [INFO] Apache Calcite Avatica Docker images ............... SKIPPED
      [INFO] Apache Calcite Avatica Dropwizard Metrics 3 ........ SKIPPED
      [INFO] Apache Calcite Avatica Noop Driver ................. SKIPPED
      [INFO] Apache Calcite Avatica Compatibility Kit ........... SKIPPED
      [INFO] Apache Calcite Avatica (Shaded) .................... SKIPPED
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------

      [...]

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              asolimando Alessandro Solimando
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: