Rob Young created FLINK-35482: --------------------------------- Summary: ParquetInt64TimestampReaderTest unit tests fail due to system timezone Key: FLINK-35482 URL: https://issues.apache.org/jira/browse/FLINK-35482 Project: Flink Issue Type: Bug Components: Tests Environment: linux version: uname -r 6.9.1-arch1-1
checked with: openjdk version "21" 2023-09-19 LTS OpenJDK Runtime Environment Temurin-21+35 (build 21+35-LTS) openjdk 17.0.5 2022-10-18 OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8) openjdk version "11.0.21" 2023-10-17 LTS OpenJDK Runtime Environment Zulu11.68+17-CA (build 11.0.21+9-LTS) openjdk version "1.8.0_382" OpenJDK Runtime Environment (Temurin)(build 1.8.0_382-b05) Reporter: Rob Young To reproduce: {code:java} export TZ=Pacific/Auckland ./mvnw -Dfast -DskipTests -Dskip.npm=true install -pl :flink-parquet -am ./mvnw test -pl :flink-parquet{code} The parquet tests fail with: {code:java} [ERROR] Failures: [ERROR] ParquetInt64TimestampReaderTest.testReadInt64TimestampMicros:46 expected:<2021-11-22T1[7]:50:20.000112> but was:<2021-11-22T1[8]:50:20.000112> [ERROR] ParquetInt64TimestampReaderTest.testReadInt64TimestampMillis:66 expected:<2021-11-22T1[7]:50:20> but was:<2021-11-22T1[8]:50:20> [ERROR] ParquetInt64TimestampReaderTest.testReadInt64TimestampNanos:78 expected:<2021-11-22T1[7]:50:20.000112233> but was:<2021-11-22T1[8]:50:20.000112233>{code} I think this is because the tests convert a LocalDateTime to epoch seconds using `OffsetDateTime.now().getOffset()` as the offset, but now's offset is different to what it would be at 2021-11-22T17:50:20.000112 NZST due to daylight savings. Instead of using now's offset we could convert the localDateTime to a zonedDateTime using `localDateTime.atZone(ZoneId.systemDefault())`. If you're happy with that idea please assign me and I'll make a PR. Another possible idea would be to set the user.timezone to GMT in the base argLine to use a consistent timezone for tests, which would be picked up by surefire and IDEA. But improving the tests feels like a better solution. Thanks -- This message was sent by Atlassian Jira (v8.20.10#820010)