Skip to content

Commit 7a30e84

Browse files
pgomulkaGurkan Kaymak
authored and
Gurkan Kaymak
committed
Remove the test which is testing java and joda api (elastic#41493)
The test is testing the java time API and fails in case it hits daylight saving time changes. Java time has the right implementation and we don't need to test this. more details on how the test was affected by the DST change on this comment closes elastic#39617
1 parent 40312fc commit 7a30e84

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

server/src/test/java/org/elasticsearch/common/rounding/DateTimeUnitTests.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
package org.elasticsearch.common.rounding;
2020

2121
import org.elasticsearch.test.ESTestCase;
22-
import org.joda.time.DateTimeZone;
23-
24-
import java.time.Instant;
25-
import java.time.ZoneId;
26-
import java.time.ZonedDateTime;
2722

2823
import static org.elasticsearch.common.rounding.DateTimeUnit.DAY_OF_MONTH;
2924
import static org.elasticsearch.common.rounding.DateTimeUnit.HOUR_OF_DAY;
@@ -33,7 +28,6 @@
3328
import static org.elasticsearch.common.rounding.DateTimeUnit.SECOND_OF_MINUTE;
3429
import static org.elasticsearch.common.rounding.DateTimeUnit.WEEK_OF_WEEKYEAR;
3530
import static org.elasticsearch.common.rounding.DateTimeUnit.YEAR_OF_CENTURY;
36-
import static org.hamcrest.Matchers.is;
3731

3832
public class DateTimeUnitTests extends ESTestCase {
3933

@@ -65,18 +59,4 @@ public void testEnumIds() {
6559
assertEquals(8, SECOND_OF_MINUTE.id());
6660
assertEquals(SECOND_OF_MINUTE, DateTimeUnit.resolve((byte) 8));
6761
}
68-
69-
@AwaitsFix( bugUrl = "https://github.com/elastic/elasticsearch/issues/39617")
70-
public void testConversion() {
71-
long millis = randomLongBetween(0, Instant.now().toEpochMilli());
72-
DateTimeZone zone = randomDateTimeZone();
73-
ZoneId zoneId = zone.toTimeZone().toZoneId();
74-
75-
int offsetSeconds = zoneId.getRules().getOffset(Instant.ofEpochMilli(millis)).getTotalSeconds();
76-
long parsedMillisJavaTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(millis), zoneId)
77-
.minusSeconds(offsetSeconds).toInstant().toEpochMilli();
78-
79-
long parsedMillisJodaTime = zone.convertLocalToUTC(millis, true);
80-
assertThat(parsedMillisJavaTime, is(parsedMillisJodaTime));
81-
}
8262
}

0 commit comments

Comments
 (0)