Skip to content

Commit

Permalink
fixed setting of search timeout and reduced timeout in tests to make …
Browse files Browse the repository at this point in the history
…tests run faster
  • Loading branch information
tomgross committed Aug 15, 2016
1 parent 28b167c commit 75cd9a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/collective/solr/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,5 @@ def setSearchTimeout(self):
""" set the timeout on the current (or to be opened) connection
to the value specified for search operations """
registry = getUtility(IRegistry)
search_timeout = registry['collective.solr.index_timeout']
search_timeout = registry['collective.solr.search_timeout']
self.setTimeout(search_timeout or None)
4 changes: 2 additions & 2 deletions src/collective/solr/tests/errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ timeout error is provoked:
>>> from collective.solr.tests.utils import fakeServer
>>> from time import sleep
>>> def action(handler):
... sleep(3)
... sleep(1.0)
>>> thread = fakeServer([action, action], port=55555)
>>> config.search_timeout = 2.0
>>> config.search_timeout = 0.7
>>> transaction.commit()

And try the search again:
Expand Down
1 change: 0 additions & 1 deletion src/collective/solr/tests/test_doctests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def test_suite():
testfiles.remove('collections.txt')
testfiles.remove('conflicts.txt')
# search ui has been replaced with react that can't be tested with zt
testfiles.remove('errors.txt')
testfiles.remove('search.txt')
for testfile in testfiles:
doc_suite = doctest.DocFileSuite(testfile,
Expand Down

0 comments on commit 75cd9a7

Please sign in to comment.