Skip to content

Flaky Test Fixed in TestStructureSerialization - #903

Merged
sbliven merged 1 commit into
biojava:masterfrom
Vidishab18:flaky_test_fixed
Dec 7, 2020
Merged

sbliven merged 1 commit into
biojava:masterfrom
Vidishab18:flaky_test_fixed

Conversation

@Vidishab18

Copy link
Copy Markdown
Contributor

The test org.biojava.nbio.structure.io.TestStructureSerialization#testSerializeStructure is flaky due to the order in which Methods are appended into the StringBuilder str.append(pdbHeader); which is built in the toString method of the StructureImpl class.

The flakiness is observed due to the non-deterministic order of pdbHeader that can produce different structures.

The flaky test is fixed by sorting the array of Methods in PDBHeader.java class using a custom comparator in the toString method.

@josemduarte josemduarte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Vidishab18

Copy link
Copy Markdown
Contributor Author

@josemduarte Thank you. Is this good to be merged ?

@sbliven

sbliven commented Dec 7, 2020

Copy link
Copy Markdown
Member

Thanks for the contribution, @Vidishab18!

@sbliven
sbliven merged commit 5cfd160 into biojava:master Dec 7, 2020
@sbliven

sbliven commented Dec 7, 2020

Copy link
Copy Markdown
Member

I merged this quickly, but after reviewing #905 I'm worried about it. This changes the order of mmcif columns in the pdbheader section. This order seems important. I think I will roll this back until we have more discussion.

@josemduarte

Copy link
Copy Markdown
Contributor

Thanks for rolling back @sbliven . I did not see the possible side issues. It will require more reviewing/discussion.

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.

3 participants