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

Fix flaky tests in guava. #1

Open
wants to merge 1 commit into
base: 2.13
Choose a base branch
from
Open

Fix flaky tests in guava. #1

wants to merge 1 commit into from

Conversation

LALAYANG
Copy link
Owner

@LALAYANG LALAYANG commented Jul 14, 2021

  1. Test failures:
  • Run:
    mvn -pl guava edu.illinois:nondex-maven-plugin:1.1.2:nondex -Dtest=com.fasterxml.jackson.datatype.guava.FluentIterableTest,
    *Here are the details of NonDex.

  • Two tests fail:
    com.fasterxml.jackson.datatype.guava.FluentIterableTest.testSerialization
    com.fasterxml.jackson.datatype.guava.FluentIterableTest.testWrappedSerialization

  • The failures:

at com.fasterxml.jackson.datatype.guava.FluentIterableTest.testSerialization(FluentIterableTest.java:37)
[ERROR] Failures:
[ERROR]   FluentIterableTest.testSerialization:37 expected:<[[1,2,3]]> but was:<[[3,1,2]]>
at com.fasterxml.jackson.datatype.guava.FluentIterableTest.testWrappedSerialization(FluentIterableTest.java:43)
[ERROR] Failures:
[ERROR]   FluentIterableTest.testWrappedSerialization:43 expected:<{"value":[[1,2,3]]}> but was:<{"value":[[3,1,2]]}>
  1. Why they fail:
  • The 2 tests fail for the same reason, MAPPER.writeValueAsString() serializes Java objects as JSON output, but the order of objects being mapped into a string by ObjectMapper changes, resulting in a different serialized JSON string.
  1. Fix them:
  • Check JSON results by JSONAssert and test assertions changes, also need to add the dependency for org.skyscreamer.jsonassert.

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

Successfully merging this pull request may close these issues.

1 participant