Skip to content

Intermittent Error in test_unwrap. #1197

Closed

Description

@blink1073

I've seen this on Py2.6, Py2.7, and Py3.2 sporadically during Travis testing.

https://travis-ci.org/scikit-image/scikit-image/jobs/37587720


======================================================================

FAIL: test_unwrap.test_wrap_around(3, 1)

----------------------------------------------------------------------

Traceback (most recent call last):

File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/nose/case.py", line 197, in runTest

self.test(*self.arg)

File "/home/travis/build/scikit-image/scikit-image/skimage/restoration/tests/test_unwrap.py", line 104, in check_wrap_around

image_unwrap_wrap_around[index_last])

File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/numpy/testing/utils.py", line 470, in assert_almost_equal

raise AssertionError(msg)

AssertionError:

Arrays are not almost equal to 7 decimals

ACTUAL: -25.132741228718345

DESIRED: 12.566370614359172

-------------------- >> begin captured stdout << ---------------------

endpoints without wrap_around: -31.4159265359 6.28318530718

endpoints with wrap_around: -25.1327412287 12.5663706144

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------

Ran 1133 tests in 91.295s

FAILED (SKIP=51, failures=1)

Activity

  1. blink1073 commented on Nov 13, 2014

    @blink1073
    ContributorAuthor

    @ahojnnes, I suspect this line might be the problem, as it is the only source of randomness I can find. The same line also exists here. Any ideas? Can we limit the range of rand() with a modulo or use srand() somewhere?

  2. jni commented on Nov 16, 2014

    @jni
    Member

    idea: punt issue with more tolerant test.

    It looks like the output merely changes the order (and/or sign? can't recall) of the output values, 12.566... and -25.132... I assume that both outputs are actually correct. (?) So, instead of figuring out wtf is wrong with the code, why don't we change the test to assert that the sorted arrays are equal? Or that the result is equal to A or B?

  3. blink1073 commented on Nov 16, 2014

    @blink1073
    ContributorAuthor

    I agree it looks like an ordering issue, which may indeed be due to the rand() call. If @ahojnnes does not disagree, I say change the test to use sorted().

  4. blink1073 commented on Nov 16, 2014

    @blink1073
    ContributorAuthor

    Actually, no, the point of the test is that the end points are equal, and we are testing the end points explicitly.

        # with wrap around, the endpoints of the image should be equal
        assert_almost_equal(image_unwrap_wrap_around[index_first],
                            image_unwrap_wrap_around[index_last])
  5. blink1073 commented on Nov 16, 2014

    @blink1073
    ContributorAuthor

    I'm testing a few things on a local branch.

  6. blink1073 commented on Nov 16, 2014

    @blink1073
    ContributorAuthor

    Opened #1225 instead.

  7. blink1073 commented on Dec 12, 2014

    @blink1073
    ContributorAuthor

    I'm closing, as no one could reproduce locally, and it has disappeared from the Travis builds.

  8. jni commented on Dec 13, 2014

    @jni
    Member

    LOL I just knew it when you wrote this that it would come back to bite us!!! LOL

  9. blink1073 commented on Dec 13, 2014

    @blink1073
    ContributorAuthor

    yeah, yeah...

  10. stefanv commented on Dec 13, 2014

    @stefanv
    Member

    I just did

    $ valgrind python skimage/restoration/tests/test_unwrap.py > /tmp/valgrind.log 2>&1
    

    and inspected the valgrind log file, but I no longer see any messages related to wrapping. Perhaps someone else can also try this under Python 2.

  11. added this to the milestone on Dec 13, 2014
  12. blink1073 commented on Dec 13, 2014

    @blink1073
    ContributorAuthor

    I must be missing something because I can't tell what you're using valgrind for here.

  13. stefanv commented on Dec 13, 2014

    @stefanv
    Member

    Making sure we're not reading from unallocated memory again, producing random results. Otherwise, why would the tests only fail sometimes?

  14. blink1073 commented on Dec 13, 2014

    @blink1073
    ContributorAuthor

    I ran it on Python 2, but have no idea how to interpret the results.

  15. jni commented on Dec 14, 2014

    @jni
    Member

    @stefanv a short tutorial blog post about valgrind would be great at this point! ;) I have no idea what it does, but it looks very intriguing indeed.

  16. ahojnnes commented on Dec 23, 2014

    @ahojnnes
    Member

    Folks, I think the sporadic test failures stopped after merging my random seed PR for the unwrapping functions. Hence, closing this issue.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions