numenta / htm.java

Hierarchical Temporal Memory implementation in Java - an official Community-Driven Java port of the Numenta Platform for Intelligent Computing (NuPIC).
GNU Affero General Public License v3.0
308 stars 160 forks source link

Test case failures under Windows #522

Closed jamesweakley closed 6 years ago

jamesweakley commented 6 years ago

Issues reported here: https://discourse.numenta.org/t/gradle-build-failed/2724/3

Based on my execution results there are a couple of different non-critical causes.

The first is to do with how file deletions are handled by the JVM in Windows. The HTMNetworkTests directory is being deleted at the end of some tests and then created again by another test, but in reality the previous one hasn’t completed yet and there is still an open handle, this causes IOExceptions. You’ll notice that if you run the failed test(s) in isolation, they will pass.

The issue in testMain is that \n is used as a line separator when streaming out, then the test asserts that this resulted in a new line. Replacing “\n” with System.lineSeparator() is the cross platform fix, as it will retain “\n” in mac/linux and use “\r\n” in Windows.