[jira] [Commented] (AVRO-2244) Problems with TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148
[ https://issues.apache.org/jira/browse/AVRO-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16693051#comment-16693051 ] ASF subversion and git services commented on AVRO-2244: --- Commit e04c2c291395339b8eb488a5e045500d366553b6 in avro's branch refs/heads/master from Thiruvalluvan M G [ https://gitbox.apache.org/repos/asf?p=avro.git;h=e04c2c2 ] AVRO-2244 Fix flaky datetime test (#386) > Problems with > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148 > --- > > Key: AVRO-2244 > URL: https://issues.apache.org/jira/browse/AVRO-2244 > Project: Apache Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Thiruvalluvan M. G. >Priority: Major > Fix For: 1.9.0 > > > I've seen an intermittent test failure that looks like this: > {{Failed tests:}} > {{ > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148}} > {{Expected: is "20:35:18.720"}} > {{ but: was "20:35:18.72"}} > When I see this failure, it's always the case that the trailing digit is > zero. I suspect that it's a bug where the trailing zero is not printed. > Since the test cases use the current time, then most of the time the trailing > digit isn't zero and the bug isn't tickled. But once-in-a-while the current > time has a trailing zero, which tickles the bug. > If this diagnosis is correct, then in addition to fixing the bug, it might be > a good idea to add tests with hard-wired, static times that cover corner > cases like this one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2244) Problems with TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148
[ https://issues.apache.org/jira/browse/AVRO-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16693047#comment-16693047 ] ASF GitHub Bot commented on AVRO-2244: -- Fokko commented on issue #386: Test and fix for AVRO-2244 URL: https://github.com/apache/avro/pull/386#issuecomment-440232578 This looks good. Thanks @thiru-apache for fixing this! This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Problems with > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148 > --- > > Key: AVRO-2244 > URL: https://issues.apache.org/jira/browse/AVRO-2244 > Project: Apache Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Thiruvalluvan M. G. >Priority: Major > Fix For: 1.9.0 > > > I've seen an intermittent test failure that looks like this: > {{Failed tests:}} > {{ > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148}} > {{Expected: is "20:35:18.720"}} > {{ but: was "20:35:18.72"}} > When I see this failure, it's always the case that the trailing digit is > zero. I suspect that it's a bug where the trailing zero is not printed. > Since the test cases use the current time, then most of the time the trailing > digit isn't zero and the bug isn't tickled. But once-in-a-while the current > time has a trailing zero, which tickles the bug. > If this diagnosis is correct, then in addition to fixing the bug, it might be > a good idea to add tests with hard-wired, static times that cover corner > cases like this one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2244) Problems with TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148
[ https://issues.apache.org/jira/browse/AVRO-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16693050#comment-16693050 ] ASF GitHub Bot commented on AVRO-2244: -- Fokko closed pull request #386: Test and fix for AVRO-2244 URL: https://github.com/apache/avro/pull/386 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificLogicalTypes.java b/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificLogicalTypes.java index ba8923980..02bea73bd 100644 --- a/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificLogicalTypes.java +++ b/lang/java/avro/src/test/java/org/apache/avro/specific/TestSpecificLogicalTypes.java @@ -27,7 +27,6 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; import java.time.temporal.ChronoField; -import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; @@ -46,6 +45,7 @@ import org.joda.time.DateTimeZone; import org.joda.time.LocalDate; import org.joda.time.LocalTime; +import org.joda.time.chrono.ISOChronology; import org.joda.time.format.ISODateTimeFormat; import org.junit.Assert; import org.junit.Rule; @@ -119,8 +119,8 @@ public void testRecordWithJsr310LogicalTypes() throws IOException { 3019.34, null, java.time.LocalDate.now(), -java.time.LocalTime.now().truncatedTo(ChronoUnit.MILLIS), -java.time.Instant.now().truncatedTo(ChronoUnit.MILLIS), +java.time.LocalTime.now(), +java.time.Instant.now(), new BigDecimal(123.45f).setScale(2, BigDecimal.ROUND_HALF_DOWN) ); @@ -133,6 +133,7 @@ public void testRecordWithJsr310LogicalTypes() throws IOException { @Test public void testAbilityToReadJsr310RecordWrittenAsJodaRecord() throws IOException { + TestRecordWithLogicalTypes withJoda = new TestRecordWithLogicalTypes( true, 34, @@ -142,7 +143,10 @@ public void testAbilityToReadJsr310RecordWrittenAsJodaRecord() throws IOExceptio null, LocalDate.now(), LocalTime.now(), -DateTime.now().withZone(DateTimeZone.UTC), +// There is no reliable way to get fixed width string from ISO_INSTANT below +// for granularity less than one second second. +new DateTime((System.currentTimeMillis() / 1000) * 1000, +ISOChronology.getInstance()).withZone(DateTimeZone.UTC), new BigDecimal(123.45f).setScale(2, BigDecimal.ROUND_HALF_DOWN) ); @@ -162,7 +166,7 @@ public void testAbilityToReadJsr310RecordWrittenAsJodaRecord() throws IOExceptio Assert.assertThat(ISO_LOCAL_DATE.format(withJsr310.getD()), is(ISODateTimeFormat.date().print(withJoda.getD(; Assert.assertThat(ISO_LOCAL_TIME.format(withJsr310.getT()), is(ISODateTimeFormat.time().print(withJoda.getT(; -Assert.assertThat(ISO_INSTANT.format(withJsr310.getTs()), is(ISODateTimeFormat.dateTime().print(withJoda.getTs(; +Assert.assertThat(ISO_INSTANT.format(withJsr310.getTs()), is(ISODateTimeFormat.dateTimeNoMillis().print(withJoda.getTs(; Assert.assertThat(withJsr310.getDec(), comparesEqualTo(withJoda.getDec())); } @@ -176,8 +180,8 @@ public void testAbilityToReadJodaRecordWrittenAsJsr310Record() throws IOExceptio 3019.34, null, java.time.LocalDate.now(), -java.time.LocalTime.now().truncatedTo(ChronoUnit.MILLIS), -java.time.Instant.now().truncatedTo(ChronoUnit.MILLIS), +java.time.LocalTime.now(), +java.time.Instant.now(), new BigDecimal(123.45f).setScale(2, BigDecimal.ROUND_HALF_DOWN) ); This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Problems with > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148 > --- > > Key: AVRO-2244 > URL: https://issues.apache.org/jira/browse/AVRO-2244 > Project: Apache Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Thiruvalluvan M. G. >Priority: Major > Fix For: 1.9.0 > > > I've seen an intermittent test failure that looks like this: >
[jira] [Commented] (AVRO-2244) Problems with TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148
[ https://issues.apache.org/jira/browse/AVRO-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16693045#comment-16693045 ] Fokko Driesprong commented on AVRO-2244: I fixed this over here: https://github.com/apache/avro/commit/25032e10a86851bdabfa29b99885ccfc03c6667e#diff-a2bcc0c4e92dfb4332f75a9d56cdb4daR73 > Problems with > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148 > --- > > Key: AVRO-2244 > URL: https://issues.apache.org/jira/browse/AVRO-2244 > Project: Apache Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Thiruvalluvan M. G. >Priority: Major > > I've seen an intermittent test failure that looks like this: > {{Failed tests:}} > {{ > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148}} > {{Expected: is "20:35:18.720"}} > {{ but: was "20:35:18.72"}} > When I see this failure, it's always the case that the trailing digit is > zero. I suspect that it's a bug where the trailing zero is not printed. > Since the test cases use the current time, then most of the time the trailing > digit isn't zero and the bug isn't tickled. But once-in-a-while the current > time has a trailing zero, which tickles the bug. > If this diagnosis is correct, then in addition to fixing the bug, it might be > a good idea to add tests with hard-wired, static times that cover corner > cases like this one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2244) Problems with TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148
[ https://issues.apache.org/jira/browse/AVRO-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16691229#comment-16691229 ] ASF GitHub Bot commented on AVRO-2244: -- thiru-apache opened a new pull request #386: Test and fix for AVRO-2244 URL: https://github.com/apache/avro/pull/386 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Problems with > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148 > --- > > Key: AVRO-2244 > URL: https://issues.apache.org/jira/browse/AVRO-2244 > Project: Apache Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Thiruvalluvan M. G. >Priority: Major > > I've seen an intermittent test failure that looks like this: > {{Failed tests:}} > {{ > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148}} > {{Expected: is "20:35:18.720"}} > {{ but: was "20:35:18.72"}} > When I see this failure, it's always the case that the trailing digit is > zero. I suspect that it's a bug where the trailing zero is not printed. > Since the test cases use the current time, then most of the time the trailing > digit isn't zero and the bug isn't tickled. But once-in-a-while the current > time has a trailing zero, which tickles the bug. > If this diagnosis is correct, then in addition to fixing the bug, it might be > a good idea to add tests with hard-wired, static times that cover corner > cases like this one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2244) Problems with TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148
[ https://issues.apache.org/jira/browse/AVRO-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16691194#comment-16691194 ] Thiruvalluvan M. G. commented on AVRO-2244: --- The fix for the problem is [here|https://github.com/thiru-apache/avro/commit/da91a1908a5a2febd644c981d8cf0b6823199f2a] > Problems with > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148 > --- > > Key: AVRO-2244 > URL: https://issues.apache.org/jira/browse/AVRO-2244 > Project: Apache Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Thiruvalluvan M. G. >Priority: Major > > I've seen an intermittent test failure that looks like this: > {{Failed tests:}} > {{ > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148}} > {{Expected: is "20:35:18.720"}} > {{ but: was "20:35:18.72"}} > When I see this failure, it's always the case that the trailing digit is > zero. I suspect that it's a bug where the trailing zero is not printed. > Since the test cases use the current time, then most of the time the trailing > digit isn't zero and the bug isn't tickled. But once-in-a-while the current > time has a trailing zero, which tickles the bug. > If this diagnosis is correct, then in addition to fixing the bug, it might be > a good idea to add tests with hard-wired, static times that cover corner > cases like this one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2244) Problems with TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148
[ https://issues.apache.org/jira/browse/AVRO-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16691177#comment-16691177 ] Thiruvalluvan M. G. commented on AVRO-2244: --- I showed how to deterministically reproduce the problem [here|https://github.com/thiru-apache/avro/commit/97fb7c28a886384482ecafe7dad0281c10357bc4] > Problems with > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148 > --- > > Key: AVRO-2244 > URL: https://issues.apache.org/jira/browse/AVRO-2244 > Project: Apache Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Assignee: Thiruvalluvan M. G. >Priority: Major > > I've seen an intermittent test failure that looks like this: > {{Failed tests:}} > {{ > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148}} > {{Expected: is "20:35:18.720"}} > {{ but: was "20:35:18.72"}} > When I see this failure, it's always the case that the trailing digit is > zero. I suspect that it's a bug where the trailing zero is not printed. > Since the test cases use the current time, then most of the time the trailing > digit isn't zero and the bug isn't tickled. But once-in-a-while the current > time has a trailing zero, which tickles the bug. > If this diagnosis is correct, then in addition to fixing the bug, it might be > a good idea to add tests with hard-wired, static times that cover corner > cases like this one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2244) Problems with TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148
[ https://issues.apache.org/jira/browse/AVRO-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16661817#comment-16661817 ] Raymie Stata commented on AVRO-2244: If there's any doubt about this issue being resolved, I just got the following error: ``` testAbilityToReadJsr310RecordWrittenAsJodaRecord(org.apache.avro.specific.TestSpecificLogicalTypes) Time elapsed: 0.085 sec <<< FAILURE! java.lang.AssertionError: Expected: is "23:43:30.800" but: was "23:43:30.8" at org.apache.avro.specific.TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord(TestSpecificLogicalTypes.java:150) ``` Personally, I would revert AVRO-2241 and figure out how to get `TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord` to output zero-padded, three-digit time stamps for the Jsr310 case. > Problems with > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148 > --- > > Key: AVRO-2244 > URL: https://issues.apache.org/jira/browse/AVRO-2244 > Project: Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Priority: Major > > I've seen an intermittent test failure that looks like this: > {{Failed tests:}} > {{ > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148}} > {{Expected: is "20:35:18.720"}} > {{ but: was "20:35:18.72"}} > When I see this failure, it's always the case that the trailing digit is > zero. I suspect that it's a bug where the trailing zero is not printed. > Since the test cases use the current time, then most of the time the trailing > digit isn't zero and the bug isn't tickled. But once-in-a-while the current > time has a trailing zero, which tickles the bug. > If this diagnosis is correct, then in addition to fixing the bug, it might be > a good idea to add tests with hard-wired, static times that cover corner > cases like this one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2244) Problems with TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148
[ https://issues.apache.org/jira/browse/AVRO-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16661123#comment-16661123 ] Raymie Stata commented on AVRO-2244: I don't believe the fix for AVRO-2241 addresses the problem in AVRO-2244: 2244 seems to be related to the _formatting_ of times, rather than the truncation of them. However, I think the reverse is true: A fix to AVRO-2244 would (have) addressed the problem seen in AVRO-2241. > Problems with > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148 > --- > > Key: AVRO-2244 > URL: https://issues.apache.org/jira/browse/AVRO-2244 > Project: Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Priority: Major > > I've seen an intermittent test failure that looks like this: > {{Failed tests:}} > {{ > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148}} > {{Expected: is "20:35:18.720"}} > {{ but: was "20:35:18.72"}} > When I see this failure, it's always the case that the trailing digit is > zero. I suspect that it's a bug where the trailing zero is not printed. > Since the test cases use the current time, then most of the time the trailing > digit isn't zero and the bug isn't tickled. But once-in-a-while the current > time has a trailing zero, which tickles the bug. > If this diagnosis is correct, then in addition to fixing the bug, it might be > a good idea to add tests with hard-wired, static times that cover corner > cases like this one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2244) Problems with TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148
[ https://issues.apache.org/jira/browse/AVRO-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16656687#comment-16656687 ] Raymie Stata commented on AVRO-2244: The spec for [ISO_LOCAL_TIME|https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#ISO_LOCAL_TIME]: "One to nine digits for the nano-of-second. As many digits will be output as required." So it's going to drop the trailing zeros. The spec for the [JODA formatter|https://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#time--] that's being used here says: "Returns a formatter for a two digit hour of day, two digit minute of hour, two digit second of minute, three digit fraction of second, and time zone offset (HH:mm:ss.SSSZZ).", i.e., it will pad with trailing zeros. So the test code in this case is buggy. > Problems with > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148 > --- > > Key: AVRO-2244 > URL: https://issues.apache.org/jira/browse/AVRO-2244 > Project: Avro > Issue Type: Bug > Components: logical types >Reporter: Raymie Stata >Priority: Major > > I've seen an intermittent test failure that looks like this: > {{Failed tests:}} > {{ > TestSpecificLogicalTypes.testAbilityToReadJsr310RecordWrittenAsJodaRecord:148}} > {{Expected: is "20:35:18.720"}} > {{ but: was "20:35:18.72"}} > When I see this failure, it's always the case that the trailing digit is > zero. I suspect that it's a bug where the trailing zero is not printed. > Since the test cases use the current time, then most of the time the trailing > digit isn't zero and the bug isn't tickled. But once-in-a-while the current > time has a trailing zero, which tickles the bug. > If this diagnosis is correct, then in addition to fixing the bug, it might be > a good idea to add tests with hard-wired, static times that cover corner > cases like this one. -- This message was sent by Atlassian JIRA (v7.6.3#76005)