New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

``core.tests.completion_test`` gives inconsistent results. #417

Closed
brownnrl opened this Issue Jan 14, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@brownnrl
Contributor

brownnrl commented Jan 14, 2015

While running tests for re-factoring purposes, I've noticed that core.tests.completion_test gives inconsistent results over enough subsequent runs. I thought it was something I did, but it does so both on my branch and master. It seems to be just these particular two. I didn't want to slow myself down looking into it, thought maybe there was some known I/O dependency or history here where this was considered acceptable.

I think I've seen this both on the windows and linux boxes... these particular results were on a windows machine.

First Run:

>py.test core\tests\completion_test.py
============================= test session starts =============================
platform win32 -- Python 3.3.5 -- py-1.4.26 -- pytest-2.6.4
plugins: monkeyplus
collected 47 items

core/tests/completion_test.py .........F.....................................

================================== FAILURES ===================================
________________________ test_complete_latest_modified ________________________

app = <core.tests.base.TestApp object at 0x000000000422D358>

    @with_app(app_one_entry)
    def test_complete_latest_modified(app):
        # Always search the latest modified entries first for completion match.
        app.add_entry('31/10/2007', 'DepositFoo')
>       eq_(complete_etable(app, 'De', 'description'), 'positFoo')
E       AssertionError: 'posit' != 'positFoo'

core\tests\completion_test.py:147: AssertionError
=============== 1 failed, 46 passed, 1 warnings in 1.18 seconds ===============

Second Run:

> py.test core\tests\completion_test.py
============================= test session starts =============================
platform win32 -- Python 3.3.5 -- py-1.4.26 -- pytest-2.6.4
plugins: monkeyplus
collected 47 items

core/tests/completion_test.py ........FF.....................................

================================== FAILURES ===================================
_________________________ test_complete_goes_to_next __________________________

app = <core.tests.base.TestApp object at 0x0000000004279F28>

    @with_app(app_one_entry)
    def test_complete_goes_to_next(app):
        # As soon as a completion gets longer than the matched entry, find another one.
        app.add_entry('1/10/2007', description='Dep')
>       eq_(complete_etable(app, 'De', 'description'), 'p')
E       AssertionError: 'posit' != 'p'

core\tests\completion_test.py:140: AssertionError
________________________ test_complete_latest_modified ________________________

app = <core.tests.base.TestApp object at 0x0000000004291828>

    @with_app(app_one_entry)
    def test_complete_latest_modified(app):
        # Always search the latest modified entries first for completion match.
        app.add_entry('31/10/2007', 'DepositFoo')
>       eq_(complete_etable(app, 'De', 'description'), 'positFoo')
E       AssertionError: 'posit' != 'positFoo'

core\tests\completion_test.py:147: AssertionError
=============== 2 failed, 45 passed, 1 warnings in 1.14 seconds ===============

Third Run:

py.test core\tests\completion_test.py
============================= test session starts =============================
platform win32 -- Python 3.3.5 -- py-1.4.26 -- pytest-2.6.4
plugins: monkeyplus
collected 47 items

core/tests/completion_test.py ...............................................

==================== 47 passed, 1 warnings in 1.09 seconds ====================

@brownnrl brownnrl changed the title from ``core.tests.completetion_test`` gives inconsistent results. to ``core.tests.completion_test`` gives inconsistent results. Jan 14, 2015

@hsoft

This comment has been minimized.

Owner

hsoft commented Jan 15, 2015

It's specific to windows. I think it has something to do with the precision of time.time() (completions are ordered by mtime).

@hsoft hsoft self-assigned this Jun 24, 2015

@hsoft hsoft closed this in ebb460f Jul 1, 2015

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