Permalink
Browse files

new: dev: print stacktrace on SIGUSR1 during tests

This is useful for debugging Kazoo's threaded retry behaviour
  • Loading branch information...
acdha committed May 27, 2016
1 parent df2b3f3 commit e7ddd730d6c608370bad1f9f6b3bc972ea5fc9f8
Showing with 15 additions and 0 deletions.
  1. +1 −0 .travis.yml
  2. +9 −0 run-tests.py
  3. +5 −0 tox.ini
View
@@ -24,6 +24,7 @@ addons:
install:
- "pip install 'requests>2'"
- "pip install ."
- 'if [[ $TRAVIS_PYTHON_VERSION == "2.7" ]]; then travis_retry pip install faulthandler; fi'
- 'if [[ "${SOLRCLOUD:-false}" == "true" ]]; then pip install -e .[solrcloud]; fi'
script:
View
@@ -3,12 +3,21 @@
from __future__ import absolute_import, print_function, unicode_literals
import signal
import traceback
import unittest
from tests import utils as test_utils
def main():
try:
import faulthandler
faulthandler.register(signal.SIGUSR1, all_threads=True)
print('Installed SIGUSR1 handler to print stack traces: pkill -USR1 -f run-tests')
except ImportError:
pass
test_utils.prepare()
test_utils.start_solr()
View
@@ -15,3 +15,8 @@ commands = {toxinidir}/run-tests.py
deps =
unittest2
{[base]deps}
[testenv:py27]
deps =
faulthandler
{[base]deps}

0 comments on commit e7ddd73

Please sign in to comment.