Produce a better message when test fails#5676
Merged
findepi merged 5 commits intotrinodb:masterfrom Oct 24, 2020
Merged
Conversation
sopel39
approved these changes
Oct 23, 2020
presto-main/src/test/java/io/prestosql/util/TestTimeZoneUtils.java
Outdated
Show resolved
Hide resolved
Previously the test would fail with something like
java.lang.AssertionError: expected [174262] but found [172032]
Expected :174262
Actual :172032
b843a61 to
7108b41
Compare
martint
approved these changes
Oct 23, 2020
| <violation> | ||
| <name>org/joda/time/DateTimeZone.toTimeZone:()Ljava/util/TimeZone;</name> | ||
| <version>1.8</version> | ||
| <comment>Avoid DateTimeZone.toTimeZone as it returns GMT for a zone not supported by the JVM. Use TimeZone.getTimeZone(ZoneId.of(dtz.getId())) instead.</comment> |
Member
There was a problem hiding this comment.
as it returns GMT for a zone not supported by the JVM
wow!
Member
Author
There was a problem hiding this comment.
I will likewise block use of TimeZone.forTimeZone(String).
Avoid TimeZone.getTimeZone as it returns GMT for a zone not supported by the JVM.
martint
approved these changes
Oct 23, 2020
aweisberg
added a commit
to aweisberg/presto
that referenced
this pull request
Feb 23, 2021
Cherrypick of trinodb/trino#4463 Cherrypick of trinodb/trino#5676 Co-authored-by: David Phillips <david@acz.org> Co-authored-by: Piotr Findeisen <piotr.findeisen@gmail.com>
arhimondr
pushed a commit
to prestodb/presto
that referenced
this pull request
Feb 24, 2021
Cherrypick of trinodb/trino#4463 Cherrypick of trinodb/trino#5676 Co-authored-by: David Phillips <david@acz.org> Co-authored-by: Piotr Findeisen <piotr.findeisen@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before the change the test fails a message that was hard to understand for me:
the change introduces a better exception message but also cleans up the test code, which was unnecessarily involving
java.util.TimeZone.