|
|
@ -871,7 +871,7 @@ class WorkerShutdownTestCase(TimeoutTestCase, RQTestCase):
|
|
|
|
|
|
|
|
|
|
|
|
@slow
|
|
|
|
@slow
|
|
|
|
def test_working_worker_cold_shutdown(self):
|
|
|
|
def test_working_worker_cold_shutdown(self):
|
|
|
|
"""worker with an ongoing job receiving double SIGTERM signal and shutting down immediately"""
|
|
|
|
"""Busy worker shuts down immediately on double SIGTERM signal"""
|
|
|
|
fooq = Queue('foo')
|
|
|
|
fooq = Queue('foo')
|
|
|
|
w = Worker(fooq)
|
|
|
|
w = Worker(fooq)
|
|
|
|
sentinel_file = '/tmp/.rq_sentinel_cold'
|
|
|
|
sentinel_file = '/tmp/.rq_sentinel_cold'
|
|
|
@ -1045,13 +1045,6 @@ class HerokuWorkerShutdownTestCase(TimeoutTestCase, RQTestCase):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestExceptionHandlerMessageEncoding(RQTestCase):
|
|
|
|
class TestExceptionHandlerMessageEncoding(RQTestCase):
|
|
|
|
def test_handle_exception_handles_non_ascii_in_exception_message(self):
|
|
|
|
|
|
|
|
"""Test that handle_exception doesn't crash on non-ascii in exception message."""
|
|
|
|
|
|
|
|
self.worker.handle_exception(Mock(), *self.exc_info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_move_to_failed_queue_handles_non_ascii_in_exception_message(self):
|
|
|
|
|
|
|
|
"""Test that move_to_failed_queue doesn't crash on non-ascii in exception message."""
|
|
|
|
|
|
|
|
self.worker.move_to_failed_queue(Mock(), *self.exc_info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
def setUp(self):
|
|
|
|
super(TestExceptionHandlerMessageEncoding, self).setUp()
|
|
|
|
super(TestExceptionHandlerMessageEncoding, self).setUp()
|
|
|
@ -1063,3 +1056,11 @@ class TestExceptionHandlerMessageEncoding(RQTestCase):
|
|
|
|
raise Exception(u"💪")
|
|
|
|
raise Exception(u"💪")
|
|
|
|
except:
|
|
|
|
except:
|
|
|
|
self.exc_info = sys.exc_info()
|
|
|
|
self.exc_info = sys.exc_info()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_handle_exception_handles_non_ascii_in_exception_message(self):
|
|
|
|
|
|
|
|
"""worker.handle_exception doesn't crash on non-ascii in exception message."""
|
|
|
|
|
|
|
|
self.worker.handle_exception(Mock(), *self.exc_info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_move_to_failed_queue_handles_non_ascii_in_exception_message(self):
|
|
|
|
|
|
|
|
"""Test that move_to_failed_queue doesn't crash on non-ascii in exception message."""
|
|
|
|
|
|
|
|
self.worker.move_to_failed_queue(Mock(), *self.exc_info)
|
|
|
|