apache / iotdb

Apache IoTDB
https://iotdb.apache.org/
Apache License 2.0
5.63k stars 1.03k forks source link

Fix Non-Deterministic Test - testChunkCache #14099

Open mohitbadve opened 2 weeks ago

mohitbadve commented 2 weeks ago

Description

The test ChunkCacheTest#testChunkCache fails under NonDex tool which detects non-deterministic nature of tests.

How to Reproduce

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

Error

java.lang.AssertionError: expected: org.apache.tsfile.file.header.ChunkHeader<CHUNK_HEADER{measurementID='null', dataSize=189, dataType=DOUBLE, compressionType=UNCOMPRESSED, encodingType=PLAIN, numOfPages=0, serializedSize=14}> but was: org.apache.tsfile.file.header.ChunkHeader<CHUNK_HEADER{measurementID='null', dataSize=189, dataType=DOUBLE, compressionType=UNCOMPRESSED, encodingType=PLAIN, numOfPages=0, serializedSize=14}>

Proposed Solution

Instead of asserting the objects directly, assert the objects' content as the objects might be different, but their content would be the same. Please let me know if you have any questions or need any additional justification/changes from my side.


This PR has:


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