Fix temporary problems with pika unit tests
Change-Id: Ib79dcd77cdae6d228507eea71ae9dcbd067ae61e
This commit is contained in:
parent
a4a4a50eb7
commit
3109828375
@ -12,7 +12,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import socket
|
||||
import threading
|
||||
import time
|
||||
import unittest
|
||||
@ -20,6 +19,7 @@ import unittest
|
||||
from concurrent import futures
|
||||
import mock
|
||||
|
||||
from oslo_messaging._drivers.pika_driver import pika_exceptions as pika_drv_exc
|
||||
from oslo_messaging._drivers.pika_driver import pika_poller
|
||||
|
||||
|
||||
@ -65,11 +65,16 @@ class PikaPollerTestCase(unittest.TestCase):
|
||||
self._pika_engine, 1, None, self._prefetch_count, None
|
||||
)
|
||||
|
||||
self._pika_engine.create_connection.side_effect = socket.timeout()
|
||||
self._pika_engine.create_connection.side_effect = (
|
||||
pika_drv_exc.EstablishConnectionException
|
||||
)
|
||||
|
||||
# start() should not raise socket.timeout exception
|
||||
poller.start(None)
|
||||
|
||||
# stop is needed to stop reconnection background job
|
||||
poller.stop()
|
||||
|
||||
@mock.patch("oslo_messaging._drivers.pika_driver.pika_poller.PikaPoller."
|
||||
"_declare_queue_binding")
|
||||
def test_message_processing(self, declare_queue_binding_mock):
|
||||
|
Loading…
x
Reference in New Issue
Block a user