Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Commit

Permalink
Change JVM time zone in product tests
Browse files Browse the repository at this point in the history
See prestodb#10078 for discussion.
  • Loading branch information
findepi committed Jul 13, 2018
1 parent dc89b6a commit 4131a6b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions presto-hive-hadoop2/bin/run_hive_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion presto-product-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`!

Expand Down
2 changes: 1 addition & 1 deletion presto-product-tests/conf/docker/files/run-tempto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion presto-product-tests/conf/presto/etc/jvm.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4131a6b

Please sign in to comment.