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

Ensure deterministic order in toConciseAlignmentString #908

Closed
wants to merge 1 commit into from

Conversation

sbliven
Copy link
Member

@sbliven sbliven commented Dec 7, 2020

Fixes #907. Uses Option 2 (TreeMap)

This is an alternative to #906.

@sbliven
Copy link
Member Author

sbliven commented Dec 7, 2020

@Vidishab18 Could you please run your tool against this version and verify that AlignmentToolsTest#testToConciseAlignmentString is deterministic now?

@@ -293,7 +293,7 @@ private synchronized boolean addToZipFileSystem(Path zipFile, File[] files, Path
*/

// Copy in each file.
try (FileSystem zipfs = FileSystems.newFileSystem(zipFile, null)) {
try (FileSystem zipfs = FileSystems.newFileSystem(zipFile, (ClassLoader) null)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This line fixes an error I was getting compiling with Java 1.8:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project biojava-structure: Compilation failure
[ERROR] /Users/bliven_s/git/biojava_ws/biojava/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/ZipChemCompProvider.java:[296,52] reference to newFileSystem is ambiguous
[ERROR]   both method newFileSystem(java.nio.file.Path,java.lang.ClassLoader) in java.nio.file.FileSystems and method newFileSystem(java.nio.file.Path,java.util.Map<java.lang.String,?>) in java.nio.file.FileSystems match

The second form isn't documented, so it could be that this change will cause a warning with different JDKs.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sbliven
I did initially try to fix this error with the same change. However the TreeMap here, is not fixing this flaky error. The tool still marks it as flaky with error of the sort -

[ERROR] Failures: 
[ERROR]   AlignmentToolsTest.testToConciseAlignmentString:342 1. Cycles. expected:<[1>2>3>1] 7>7> but was:<[2>3>1>2] 7>7>
[INFO] 
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

Copy link
Contributor

@Vidishab18 Vidishab18 Dec 7, 2020

Choose a reason for hiding this comment

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

@sbliven @josemduarte

Would like to link the Nondex tool here : https://github.com/TestingResearchIllinois/NonDex

The tool requires :

  • Adding the plugin as specified in the documentation which applies if you want to run NonDex mutliple times.

  • Run for the test -
    mvn -pl biojava-integrationtest nondex:nondex -Dtest=AlignmentToolsTest#testToConciseAlignmentString

  • Run for the whole module -
    mvn -pl biojava-integrationtest nondex:nondex.

  • Otherwise, one need not add the plugin to pom.xml file(s) and can run just run mvn edu.illinois:nondex-maven-plugin:1.1.2:nondex instead of mvn test. Please check that the command does work for you.

This could be added into travis.yml, so it can be run on new tests too.

It also has the debug feature that can be used to point to the file(s) that could require changes. The link to the tool has all the documentation.

@sbliven
Copy link
Member Author

sbliven commented Dec 11, 2020

It looks like more effort is needed to make this deterministic.

@sbliven
Copy link
Member Author

sbliven commented Dec 16, 2020

I intend to figure this out (and #909) but I got sidetracked this week. It might not get fixed until after Christmas.

@josemduarte
Copy link
Contributor

This has been inactive a long time. I'll close

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.

toConciseAlignmentString is non-deterministic
3 participants