Skip to content

Conversation

@lee-mcfaul
Copy link
Contributor

Although I couldn't reproduce the original error in #800 (I suspect that maybe the user didn't have a version of the libraries that included the fix in #666 ) I followed the method documentation and moved the close action to process() from process(int) since process(int) should never close the resource under any circumstances.

Also verified that the underlying InputStream was open and closed at appropriate steps.

Used streams to reduce complexity of a double nested for loop.(If that's frowned upon I'll change it back)

Tweaked documentation to use links when referring to library classes.

Although I couldn't reproduce the original error. I followed the method documentation and moved the close action to process() from process(int) since process(int) should never close the resource under any circumstances anyhow.

Also went out of scope a little and verified that the underlying InputStream was open and closed at appropriate steps.

Used streams to reduce complexity of a double nested for loop.(If that's frowned upon I'll change it back)

Tweaked documentation to use links when refering to library classes.
Copy link
Member

@heuermh heuermh left a comment

Choose a reason for hiding this comment

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

minor code style suggestions

Added braces to if statement
Removed main method
Made style change to isClosed() method
@lee-mcfaul
Copy link
Contributor Author

lee-mcfaul commented Feb 19, 2019

Looks like the failing test is in TestUncompressInputStream.java. Which is also failing in master. I compared the original input and the processed array to file and they appear identical at first glance. I'll poke around and see if I can't find out wha't causing the issue.

`java.lang.AssertionError: array lengths differed, expected.length=9068 actual.length=9257

at org.junit.Assert.fail(Assert.java:88)
at org.junit.internal.ComparisonCriteria.assertArraysAreSameLength(ComparisonCriteria.java:76)
at org.junit.internal.ComparisonCriteria.arrayEquals(ComparisonCriteria.java:37)
at org.junit.Assert.internalArrayEquals(Assert.java:532)
at org.junit.Assert.assertArrayEquals(Assert.java:341)
at org.junit.Assert.assertArrayEquals(Assert.java:352)
at org.biojava.nbio.core.util.TestUncompressInputStream.testUncompression(TestUncompressInputStream.java:70)

@lee-mcfaul
Copy link
Contributor Author

It's the line breaks in 'org/biojava/nbio/core/util/build.xml': they're set to windows line breaks instead of linux ones. I'll put in a pull request.

@lee-mcfaul
Copy link
Contributor Author

That test now passes... however we got 429 (too many requests) response codes in other tests.

@josemduarte
Copy link
Contributor

Good catch @lee-mcfaul ! Thanks for fixing the test. It might have broken when re-formatting all code with an automated script in a recent release.

I did go through the same fix before that (see e78ea4c)

Copy link
Contributor

@josemduarte josemduarte left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you! Special thanks for improving docs

Normally I would have opened a new branch. but this issue was causing this pull to fail it's build so I'm doing both in one fel swoop.

I put the target files in the resource directory and manually copy them over before each test into the temporary working directory which is scanned before calling out in case the file is already there. this should fix the 429 errors in this class specifically.
Fixing missing slash on the travis build server (works without fix on windows but added check for backslash anyhow)
@lee-mcfaul
Copy link
Contributor Author

Unit tests passing now. Integration tests failed with a closed ssh connection https://travis-ci.org/biojava/biojava/jobs/496850065

Copy link
Contributor

@josemduarte josemduarte left a comment

Choose a reason for hiding this comment

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

Thank you again. I think the extra commons-io library is not necessary here.

@josemduarte
Copy link
Contributor

I've restarted the build. That ssl connection is another external resource that's flaky

Removed use of apache io library
@lee-mcfaul
Copy link
Contributor Author

This is turning into a rabbit hole. Any objections to me going through the integration tests, adding any quick fixes to this pull request and setting more complex issues to ignore and creating issues for them?

Copy link
Contributor

@josemduarte josemduarte left a comment

Choose a reason for hiding this comment

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

Thanks, the test changes are great to avoid using the external resource.

I have just one more comment about where to store the new resource files.

@josemduarte
Copy link
Contributor

Regarding fixing other tests: it'd be great if you could help there and remove as many dependencies on external resources as possible. But it'd be better to do that in separate PRs. The issue that should be referenced is #606

@lee-mcfaul
Copy link
Contributor Author

alright, build succeeded. backing away from this pr slowly. I'll have a peek at #606 next

Copy link
Contributor

@josemduarte josemduarte left a comment

Choose a reason for hiding this comment

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

Looks great, thanks again!

@josemduarte
Copy link
Contributor

@heuermh could you give this another look and see if you are happy with it?

@josemduarte
Copy link
Contributor

I will merge this in tomorrow, unless someone says something against it.

@josemduarte josemduarte merged commit 323cd9f into biojava:master Mar 8, 2019
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