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 Test MetaUtilsTest #13982

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

Conversation

mohitbadve
Copy link

@mohitbadve mohitbadve commented Nov 4, 2024

Description

The test org.apache.iotdb.db.metadata.MetaUtilsTest#testParseDeadbandInfo fails under NonDex tool which detects non-deterministic nature of tests with when non-deterministic data structures are used. The failure is because of hashmap.toString() being compared directly and hashmap doesn't gurantee ordering.

How to Reproduce

mvn -pl iotdb-core/datanode edu.illinois:nondex-maven-plugin:2.1.7:nondex
-Dtest=MetaUtilsTest#testParseDeadbandInfo
-DnondexRuns=10

Error

[ERROR] org.apache.iotdb.db.metadata.MetaUtilsTest.testParseDeadbandInfo -- Time elapsed: 1.257 s <<< FAILURE!
org.junit.ComparisonFailure: expected:<{comp[mintime=2, compmaxtime=10, compdev=0.01]}> but was:<{comp[dev=0.01, compmintime=2, compmaxtime=10]}>
at org.junit.Assert.assertEquals(Assert.java:117)
at org.junit.Assert.assertEquals(Assert.java:146)
at org.apache.iotdb.db.metadata.MetaUtilsTest.testParseDeadbandInfo(MetaUtilsTest.java:194) ...

Proposed Solution

Implement parseHashmap method to parse the string and convert it into hashmap, and then compare it with the expected hashmap.

Please let me know if you have any questions or need any additional justification/changes from my side.


This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the "why" and the intent of the code wherever would not be obvious
    for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

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