From 4131a6b5064ab35949e6d4e13bd262ce7257a611 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Fri, 29 Jun 2018 12:06:26 +0200 Subject: [PATCH] Change JVM time zone in product tests See https://github.com/prestodb/presto/issues/10078 for discussion. --- presto-hive-hadoop2/bin/run_hive_tests.sh | 3 +-- presto-product-tests/README.md | 2 +- presto-product-tests/conf/docker/files/run-tempto.sh | 2 +- .../conf/docker/singlenode-cassandra/docker-compose.yml | 2 +- presto-product-tests/conf/presto/etc/jvm.config | 2 +- .../com/facebook/presto/tests/TemptoProductTestRunner.java | 2 +- .../facebook/presto/tests/teradata/TestTeradataFunctions.java | 4 ++-- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/presto-hive-hadoop2/bin/run_hive_tests.sh b/presto-hive-hadoop2/bin/run_hive_tests.sh index c84ea427b34c..978ee5b55d90 100755 --- a/presto-hive-hadoop2/bin/run_hive_tests.sh +++ b/presto-hive-hadoop2/bin/run_hive_tests.sh @@ -17,13 +17,12 @@ stop_unnecessary_hadoop_services pushd ${PROJECT_ROOT} set +e ./mvnw -B -pl presto-hive-hadoop2 test -P test-hive-hadoop2 \ - -Dhive.hadoop2.timeZone=UTC \ -DHADOOP_USER_NAME=hive \ -Dhive.hadoop2.metastoreHost=localhost \ -Dhive.hadoop2.metastorePort=9083 \ -Dhive.hadoop2.databaseName=default \ -Dhive.hadoop2.metastoreHost=hadoop-master \ - -Dhive.hadoop2.timeZone=Asia/Kathmandu \ + -Dhive.hadoop2.timeZone=America/Bahia_Banderas \ -Dhive.metastore.thrift.client.socks-proxy=${PROXY}:1180 \ -Dsun.net.spi.nameservice.provider.1=default \ -Dsun.net.spi.nameservice.provider.2=dns,dnsjava \ diff --git a/presto-product-tests/README.md b/presto-product-tests/README.md index f432434bfb47..8bedeef22b05 100644 --- a/presto-product-tests/README.md +++ b/presto-product-tests/README.md @@ -394,7 +394,7 @@ with the following parameters: - Use classpath of module: `presto-main` - Main class: `com.facebook.presto.server.PrestoServer` - Working directory: `presto-product-tests/conf/presto` - - VM options: `-ea -Xmx2G -Dconfig=etc/config.properties -Dlog.levels-file=etc/log.properties -DHADOOP_USER_NAME=hive -Duser.timezone=Asia/Kathmandu` + - VM options: `-ea -Xmx2G -Dconfig=etc/config.properties -Dlog.levels-file=etc/log.properties -DHADOOP_USER_NAME=hive -Duser.timezone=America/Bahia_Banderas` 5. MAKE SURE PRESTO CONFIGURATION IS ALIGNED WITH THE ONE IN `presto-product-tests/conf/presto`! diff --git a/presto-product-tests/conf/docker/files/run-tempto.sh b/presto-product-tests/conf/docker/files/run-tempto.sh index 1afa5aa873a4..e4f2f34a9628 100755 --- a/presto-product-tests/conf/docker/files/run-tempto.sh +++ b/presto-product-tests/conf/docker/files/run-tempto.sh @@ -16,7 +16,7 @@ fi java \ "-Djava.util.logging.config.file=${DOCKER_TEMPTO_CONF_DIR}/logging.properties" \ - -Duser.timezone=Asia/Kathmandu \ + -Duser.timezone=America/Bahia_Banderas \ -cp "/docker/volumes/jdbc/driver.jar:/docker/volumes/presto-product-tests/presto-product-tests-executable.jar" \ com.facebook.presto.tests.TemptoProductTestRunner \ --report-dir "/docker/volumes/test-reports" \ diff --git a/presto-product-tests/conf/docker/singlenode-cassandra/docker-compose.yml b/presto-product-tests/conf/docker/singlenode-cassandra/docker-compose.yml index ba72741d650b..5eea32f446a2 100644 --- a/presto-product-tests/conf/docker/singlenode-cassandra/docker-compose.yml +++ b/presto-product-tests/conf/docker/singlenode-cassandra/docker-compose.yml @@ -10,4 +10,4 @@ services: - HEAP_NEWSIZE=128M - MAX_HEAP_SIZE=512M entrypoint: [] - command: [bash, -cxeu, "ln -snf /usr/share/zoneinfo/Asia/Kathmandu /etc/localtime && echo Asia/Kathmandu > /etc/timezone && /docker-entrypoint.sh cassandra -f"] + command: [bash, -cxeu, "ln -snf /usr/share/zoneinfo/America/Bahia_Banderas /etc/localtime && echo America/Bahia_Banderas > /etc/timezone && /docker-entrypoint.sh cassandra -f"] diff --git a/presto-product-tests/conf/presto/etc/jvm.config b/presto-product-tests/conf/presto/etc/jvm.config index 8b8a99a119e8..131dd7db6100 100644 --- a/presto-product-tests/conf/presto/etc/jvm.config +++ b/presto-product-tests/conf/presto/etc/jvm.config @@ -14,6 +14,6 @@ -XX:+ExitOnOutOfMemoryError -XX:ReservedCodeCacheSize=150M -DHADOOP_USER_NAME=hive --Duser.timezone=Asia/Kathmandu +-Duser.timezone=America/Bahia_Banderas #-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -XX:ErrorFile=/docker/volumes/logs/product-tests-presto-jvm-error-file.log diff --git a/presto-product-tests/src/main/java/com/facebook/presto/tests/TemptoProductTestRunner.java b/presto-product-tests/src/main/java/com/facebook/presto/tests/TemptoProductTestRunner.java index 1fc2c6c3cceb..e56bf0191eed 100644 --- a/presto-product-tests/src/main/java/com/facebook/presto/tests/TemptoProductTestRunner.java +++ b/presto-product-tests/src/main/java/com/facebook/presto/tests/TemptoProductTestRunner.java @@ -19,7 +19,7 @@ public class TemptoProductTestRunner { - public static final DateTimeZone PRODUCT_TESTS_TIME_ZONE = DateTimeZone.forID("Asia/Kathmandu"); + public static final DateTimeZone PRODUCT_TESTS_TIME_ZONE = DateTimeZone.forID("America/Bahia_Banderas"); public static void main(String[] args) { diff --git a/presto-product-tests/src/main/java/com/facebook/presto/tests/teradata/TestTeradataFunctions.java b/presto-product-tests/src/main/java/com/facebook/presto/tests/teradata/TestTeradataFunctions.java index 2c90e1781a9d..9478901f1ca4 100644 --- a/presto-product-tests/src/main/java/com/facebook/presto/tests/teradata/TestTeradataFunctions.java +++ b/presto-product-tests/src/main/java/com/facebook/presto/tests/teradata/TestTeradataFunctions.java @@ -14,11 +14,11 @@ package com.facebook.presto.tests.teradata; import io.prestodb.tempto.ProductTest; -import org.joda.time.DateTimeZone; import org.testng.annotations.Test; import java.sql.Date; +import static com.facebook.presto.tests.TemptoProductTestRunner.PRODUCT_TESTS_TIME_ZONE; import static com.facebook.presto.tests.TestGroups.FUNCTIONS; import static com.facebook.presto.tests.utils.QueryExecutors.onPresto; import static io.prestodb.tempto.assertions.QueryAssert.Row.row; @@ -53,7 +53,7 @@ public void testToDate() public void testToTimestamp() { assertThat(onPresto().executeQuery("SELECT to_timestamp('1988/04/08;02:03:04','yyyy/mm/dd;hh24:mi:ss')")) - .contains(row(parseTimestampInLocalTime("1988-04-08 02:03:04.0", DateTimeZone.forID("Asia/Kathmandu")))); + .contains(row(parseTimestampInLocalTime("1988-04-08 02:03:04.0", PRODUCT_TESTS_TIME_ZONE))); } @Test(groups = FUNCTIONS)