Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent circe-java8 failure #280

Closed
travisbrown opened this issue Apr 28, 2016 · 3 comments
Closed

Intermittent circe-java8 failure #280

travisbrown opened this issue Apr 28, 2016 · 3 comments

Comments

@travisbrown
Copy link
Member

Possibly related to #275.

[info] - Codec[ZonedDateTime].codec.roundTrip *** FAILED ***
[info]   GeneratorDrivenPropertyCheckFailedException was thrown during property evaluation.
[info]    (Discipline.scala:14)
[info]     Falsified after 5 successful property evaluations.
[info]     Location: (Discipline.scala:14)
[info]     Occurred when passed generated values (
[info]       arg0 = 2705-12-05T17:49:07Z[GMT0]
[info]     )
[info]     Label of failing property:
[info]       (Left(DecodingFailure(ZonedDateTime, List())) ?== Right(2705-12-05T17:49:07Z[GMT0])) failed
@liff
Copy link
Contributor

liff commented May 18, 2016

Looks like ISO_ZONED_DATE_TIME cannot always parse its own output :)

scala> val original = ZonedDateTime.parse("2001-02-03T04:05:06Z")
original: java.time.ZonedDateTime = 2001-02-03T04:05:06Z

scala> val ok1 = ZonedDateTime.parse(original.toString)
ok1: java.time.ZonedDateTime = 2001-02-03T04:05:06Z

scala> val hki = original.withZoneSameInstant(ZoneId.of("Europe/Helsinki"))
hki: java.time.ZonedDateTime = 2001-02-03T06:05:06+02:00[Europe/Helsinki]

scala> val ok2 = ZonedDateTime.parse(hki.toString)
ok2: java.time.ZonedDateTime = 2001-02-03T06:05:06+02:00[Europe/Helsinki]

scala> val gmt0 = original.withZoneSameInstant(ZoneId.of("GMT0"))
gmt0: java.time.ZonedDateTime = 2001-02-03T04:05:06Z[GMT0]

scala> val bad = ZonedDateTime.parse(gmt0.toString)
java.time.format.DateTimeParseException: Text '2001-02-03T04:05:06Z[GMT0]' could not be parsed, unparsed text found at index 20
…

@liff
Copy link
Contributor

liff commented May 18, 2016

JDK bug: JDK-8138664. From what I can tell it'll be fixed in Java 9?

@travisbrown
Copy link
Member Author

Ugh. Thanks for figuring this out, @liff. I guess we should add a filter to the Arbitrary instance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants