Skip to content

Intermittent test failures especially in test_search #58

Open
@jayvdb

Description

@jayvdb

Investigating the build failures on #57 , there are many intermittent errors, mostly in the test_search assertion added by #55.

The #57 build status were:

  1. green
  2. green
  3. red - py2.7 - test_search
  4. red - py3.5 - test_search
  5. red - py3.5 - test_search and test_peers

I have done some Travis builds of master (78456e7), with results:

  1. green
  2. red - py35 - test_search
  3. green
  4. red - py27 - test_search

The test_peers failure has only occurred once so far.

$ nosetests --with-coverage tests
....F.F...
======================================================================
FAIL: Test finding peers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/loklak/loklak_python_api/tests/test.py", line 77, in test_peers
    self.assertTrue('peers' in result)
AssertionError: False is not true
...

The logging is always correctly reporting:

requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): loklak.org
requests.packages.urllib3.connectionpool: DEBUG: "GET /api/search.json?count=18&query=doctor+who HTTP/1.1" 200 None

The test_search failures on Python 3.5 is always in the number of results:

$ nosetests --with-coverage tests
......F...
======================================================================
FAIL: test search result
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jayvdb/loklak_python_api/tests/test.py", line 108, in test_search
    self.assertEqual(int(result['search_metadata']['count']), 18)
AssertionError: 17 != 18

https://travis-ci.org/loklak/loklak_python_api/jobs/159657573 is slightly different, with fewer returned results

$ nosetests --with-coverage tests
......F...
======================================================================
FAIL: Test search result.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/loklak/loklak_python_api/tests/test.py", line 110, in test_search
    self.assertEqual(int(result['search_metadata']['count']), 18)
AssertionError: 13 != 18

And this one only has 10 results:
https://travis-ci.org/loklak/loklak_python_api/jobs/159662252

======================================================================
FAIL: Test search result.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/loklak/loklak_python_api/tests/test.py", line 110, in test_search
    self.assertEqual(int(result['search_metadata']['count']), 18)
AssertionError: 10 != 18

On Python 2.7 it varies more, with higher results and other problems.

https://travis-ci.org/jayvdb/loklak_python_api/jobs/159741504 :

$ nosetests --with-coverage tests
......F...
======================================================================
FAIL: test search result
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jayvdb/loklak_python_api/tests/test.py", line 105, in test_search
    self.assertTrue(len(result['statuses']) >= 1)
AssertionError: False is not true

https://travis-ci.org/loklak/loklak_python_api/jobs/159654156 :

$ nosetests --with-coverage tests
......F...
======================================================================
FAIL: Test search result.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/loklak/loklak_python_api/tests/test.py", line 109, in test_search
    int(result['search_metadata']['count']))
AssertionError: 24 != 14

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions