Skip to content

Tests failed #549

Open
Open

Description

@MaJeg

I cloned the git repository with git clone https://github.com/numenta/htm.java.git
Then, when running gradle -Pskipbench check, I have two failed tests :

org.numenta.nupic.BitHistoryTest > testPFormatArray FAILED
    org.junit.ComparisonFailure at BitHistoryTest.java:22

org.numenta.nupic.monitor.mixin.MonitoredTemporalMemoryTest > test_mmPrettyPrintConnections FAILED
    java.lang.AssertionError at MonitoredTemporalMemoryTest.java:42
654 tests completed, 2 failed
:test FAILED 

I tested with java 8 and java 11 it didn't change anything, I have Ubuntu 18.04.

Activity

  1. msche commented on May 11, 2019

    @msche

    I encountered a similar problem within this test and it seems to be caused by the locale settings. It expects that the decimal seperator is a . but for certain locales it is ,.

    I quick fixed this locally by changing the test in BitHistory in

        @Test
        public void testPFormatArray() {
            BitHistory history = new BitHistory(null, 1, 1);
            Method m = null;
            try {
                m = BitHistory.class.getDeclaredMethod("pFormatArray", new Class[] {double[].class});
                m.setAccessible(true);
                double[] da = { 2.0, 4.0 };
                String output = (String)m.invoke(history, da);
    
                // Correct for locale
                DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance();
                char decimalSeparator = symbols.getDecimalSeparator();
    
                assertEquals("[ 2" +decimalSeparator + "00 4" + decimalSeparator + "00 ]", output);
            }catch(Exception e) {
                e.printStackTrace();
            }
        }

    ps: saw just that there is already a pull request for fixing this issue: #536

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions