#NEWLINE# def test_proxy_disconnect_with_active_worker( container_factory , rabbit_manager , rabbit_config ) : #NEWLINE# #INDENT# " Break the connection to rabbit while a service's queue consumer and\n    rabbit while the service has an in-flight rpc request (i.e. it is waiting\n    on a reply).\n    " #NEWLINE# proxy_container = container_factory ( ProxyService , rabbit_config ) #NEWLINE# example_container = container_factory ( ExampleService , rabbit_config ) #NEWLINE# proxy_container . start ( ) #NEWLINE# vhost = rabbit_config [ 'vhost' ] #NEWLINE# connections = get_rabbit_connections ( vhost , rabbit_manager ) #NEWLINE# assert ( len ( connections ) == 1 ) #NEWLINE# proxy_consumer_conn = connections [ 0 ] [ 'name' ] #NEWLINE# example_container . start ( ) #NEWLINE# connections = get_rabbit_connections ( vhost , rabbit_manager ) #NEWLINE# assert ( len ( connections ) == 2 ) #NEWLINE# eventlet . spawn ( disconnect_on_event , rabbit_manager , proxy_consumer_conn ) #NEWLINE# with entrypoint_hook ( proxy_container , 'retry' ) as retry : #NEWLINE# #INDENT# assert ( retry ( 'hello' ) == [ ( RpcConnectionError , 'Disconnected while waiting for reply' ) , 'duplicate-call-result' ] ) #NEWLINE# #UNINDENT# connections = get_rabbit_connections ( vhost , rabbit_manager ) #NEWLINE# assert ( proxy_consumer_conn not in [ conn [ 'name' ] for conn in connections ] )