jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Schumacher <felix.schumac...@internetallee.de>
Subject Re: failing timeshift test
Date Sun, 08 Mar 2020 10:47:00 GMT

Am 07.03.20 um 14:56 schrieb Felix Schumacher:
> Hi all,
>
> the test TestTimeShiftFunction#testNowWithComplexPeriod is failing
> probably due to a transition period shortly before day light saving time
> switch.

Seems the test failed on travis and for jdk 13, only
(https://travis-ci.org/apache/jmeter/jobs/656886259)

Felix

>
> The code is
>
> @Test
>     public void testNowWithComplexPeriod() throws Exception {
>         Collection<CompoundVariable> params =
> makeParams("yyyy-MM-dd'T'HH:mm:ss", "", "P10DT-1H-5M5S", "");
>         function.setParameters(params);
>         value = function.execute(result, null);
>         LocalDateTime futureDate =
> LocalDateTime.now().plusDays(10).plusHours(-1).plusMinutes(-5).plusSeconds(5);
>         LocalDateTime futureDateFromFunction = LocalDateTime.parse(value);
>         assertThat(futureDateFromFunction, within(1, ChronoUnit.SECONDS,
> futureDate));
>     }
>
> any idea how to make it aware of this transition period without giving
> up a non timezone aware current time?
>
> I thought of checking the day light settings for the locale for the
> current and the future date, and calculating a difference if necessary.
>
> Felix
>

Mime
View raw message