You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Xintong Song (Jira)" <ji...@apache.org> on 2024/09/02 09:35:01 UTC

[jira] [Updated] (FLINK-35482) ParquetInt64TimestampReaderTest unit tests fail due to system timezone

     [ https://issues.apache.org/jira/browse/FLINK-35482?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xintong Song updated FLINK-35482:
---------------------------------
    Fix Version/s: 2.0-preview

> 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
>    Affects Versions: 1.20.0, 1.19.1
>         Environment: on master commit 89c89d8522f779986f3f6f163d803e5d5f11ec62 (HEAD -> master, origin/master, origin/HEAD)
> 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
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 2.0.0, 1.19.2, 1.20.1, 2.0-preview
>
>
> 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)