← 输入框|github.com|刷新
Skip to content

Ensure deterministic order in toConciseAlignmentString - #908

Closed
sbliven wants to merge 1 commit into
biojava:masterfrom
sbliven:fix-907
Closed

sbliven wants to merge 1 commit into
biojava:masterfrom
sbliven:fix-907

Conversation

@sbliven

@sbliven sbliven commented Dec 7, 2020

Copy link
Copy Markdown
Member

Fixes #907. Uses Option 2 (TreeMap)

This is an alternative to #906.

@sbliven

sbliven commented Dec 7, 2020

Copy link
Copy Markdown
Member Author

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


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

Copy link
Copy Markdown
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
Copy Markdown
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

@Vidishab18 Vidishab18 Dec 7, 2020 •

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.

@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

sbliven commented Dec 11, 2020

Copy link
Copy Markdown
Member Author

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

@sbliven

sbliven commented Dec 16, 2020

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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