Skip to content

Conversation

@Shilpa-Rani
Copy link
Owner

Fixed the following Flaky Tests:
' org.biojava.nbio.structure.io.TestMMCIFWriting#test1A2C
org.biojava.nbio.structure.io.TestMMCIFWriting#test1SMT
org.biojava.nbio.structure.io.TestMMCIFWriting#test2N3J
org.biojava.nbio.structure.io.TestMMCIFWriting#testBiounitWriting
org.biojava.nbio.structure.TestStructureSerialization#testSerializeStructure '

This commit fixes all the flaky tests in the biojava-structure module.

The above-mentioned tests fail because of non-determinism caused due to various reasons. Because the order of elements in Array objects("methods" and "fields") is not deterministic, these tests can fail for a different order. Sorting the fields makes these tests pass.
Also, the Oracle specification about HashMap says that “This class makes no guarantees as to the order of the map; in particular, it does not guarantee that the order will remain constant over time.” The documentation is here for your reference:https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html

So, we have changed it to LinkedHashMap for making the tests execute deterministically.

checkIfValidStrForIntConversion() module is added SimpleMMcifParser to get rid of the bug that still allowed non parsable Integers to be passed to Integer.parseInt().

Shilpa-Rani and others added 2 commits November 20, 2020 21:56
org.biojava.nbio.structure.io.StructureSequenceMatcherTest#testGetProteinSequenceForStructure
org.biojava.nbio.structure.io.TestMMCIFWriting#testBeanAnnotations
org.biojava.nbio.structure.io.FastaAFPChainConverterTest#testFromFasta
org.biojava.nbio.structure.secstruc.TestSecStrucCalc#testMultiModelPred
org.biojava.nbio.structure.secstruc.TestSecStrucCalc#testSecStrucPred
org.biojava.nbio.structure.align.util.AtomCacheTest#testGetStructureForChainlessDomains
org.biojava.nbio.structure.basepairs.TestBasePairParameters#testBasePair
org.biojava.nbio.structure.cluster.TestSubunitCluster#testMergeStructure
org.biojava.nbio.structure.cluster.TestSubunitExtractor#testHistone
org.biojava.nbio.structure.TestParsingCalcium#testCalciumParsing
org.biojava.nbio.structure.AtomPositionMapTest#testChains
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.

2 participants