Unstable nosetests wrt login

Thomas De Schampheleire patrickdepinguin at gmail.com
Sun Feb 22 06:29:39 EST 2015


Hi,

When running nosetests, I sometimes see a few tests failing,
inconsistently. The errors are:

======================================================================
ERROR: test_index_with_anonymous_access_disabled
(kallithea.tests.functional.test_home.TestHomeController)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_home.py",
line 42, in test_index_with_anonymous_access_disabled
    status=302)
  File "/home/tdescham/repo/contrib/kallithea/dist/v/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py",
line 759, in get
    expect_errors=expect_errors)
  File "/home/tdescham/repo/contrib/kallithea/dist/v/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py",
line 1121, in do_request
    self._check_status(status, res)
  File "/home/tdescham/repo/contrib/kallithea/dist/v/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py",
line 1160, in _check_status
    "Bad response: %s (not %s)", res_status, status)
AppError: Bad response: 200 OK (not 302)

======================================================================
ERROR: test_repo_summary_with_anonymous_access_disabled
(kallithea.tests.functional.test_home.TestHomeController)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_home.py",
line 36, in test_repo_summary_with_anonymous_access_disabled
    status=302)
  File "/home/tdescham/repo/contrib/kallithea/dist/v/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py",
line 759, in get
    expect_errors=expect_errors)
  File "/home/tdescham/repo/contrib/kallithea/dist/v/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py",
line 1121, in do_request
    self._check_status(status, res)
  File "/home/tdescham/repo/contrib/kallithea/dist/v/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py",
line 1160, in _check_status
    "Bad response: %s (not %s)", res_status, status)
AppError: Bad response: 200 OK (not 302)

======================================================================
ERROR: test_access_not_whitelisted_page_via_api_key_0_none
(kallithea.tests.functional.test_login.TestLoginController)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tdescham/repo/contrib/kallithea/kallithea/tests/nose_parametrized.py",
line 94, in parameterized_expand_helper_helper
    return func(*(self + args))
  File "/home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_login.py",
line 322, in test_access_not_whitelisted_page_via_api_key
    status=302)
  File "/home/tdescham/repo/contrib/kallithea/dist/v/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py",
line 759, in get
    expect_errors=expect_errors)
  File "/home/tdescham/repo/contrib/kallithea/dist/v/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py",
line 1121, in do_request
    self._check_status(status, res)
  File "/home/tdescham/repo/contrib/kallithea/dist/v/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py",
line 1160, in _check_status
    "Bad response: %s (not %s)", res_status, status)
AppError: Bad response: 200 OK (not 302)

======================================================================
ERROR: test_access_not_whitelisted_page_via_api_key_1_empty_string
(kallithea.tests.functional.test_login.TestLoginController)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tdescham/repo/contrib/kallithea/kallithea/tests/nose_parametrized.py",
line 94, in parameterized_expand_helper_helper
    return func(*(self + args))
  File "/home/tdescham/repo/contrib/kallithea/kallithea/tests/functional/test_login.py",
line 322, in test_access_not_whitelisted_page_via_api_key
    status=302)
  File "/home/tdescham/repo/contrib/kallithea/dist/v/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py",
line 759, in get
    expect_errors=expect_errors)
  File "/home/tdescham/repo/contrib/kallithea/dist/v/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py",
line 1121, in do_request
    self._check_status(status, res)
  File "/home/tdescham/repo/contrib/kallithea/dist/v/local/lib/python2.7/site-packages/WebTest-1.4.3-py2.7.egg/webtest/app.py",
line 1160, in _check_status
    "Bad response: %s (not %s)", res_status, status)
AppError: Bad response: 200 OK (not 302)

----------------------------------------------------------------------
Ran 1507 tests in 700.694s

FAILED (SKIP=5, errors=4)


So it looks like an access that is supposed to be blocked is allowed anyhow.

Running the tests again typically 'solves' the problem.
I tried running the offending tests over and over again, but it does
not reproduce.

I have seen this issue several times already, but very inconsistently.

Is anyone else seeing this?
Is it a test problem or rather a Kallithea bug?

Thanks,
Thomas


More information about the kallithea-general mailing list