@@ -161,7 +161,7 @@ vhost_failure_forces_connection_closure(Config) ->
161161 [_Conn2 ] = open_connections (Config , [{0 , VHost2 }]),
162162 ? assertEqual (1 , count_connections_in (Config , VHost2 )),
163163
164- force_vhost_failure (Config , VHost2 ),
164+ rabbit_ct_broker_helpers : force_vhost_failure (Config , VHost2 ),
165165 timer :sleep (200 ),
166166 ? assertEqual (0 , count_connections_in (Config , VHost2 )),
167167
@@ -181,7 +181,7 @@ dead_vhost_connection_refused(Config) ->
181181 ? assertEqual (0 , count_connections_in (Config , VHost1 )),
182182 ? assertEqual (0 , count_connections_in (Config , VHost2 )),
183183
184- force_vhost_failure (Config , VHost2 ),
184+ rabbit_ct_broker_helpers : force_vhost_failure (Config , VHost2 ),
185185 timer :sleep (200 ),
186186
187187 [_Conn1 ] = open_connections (Config , [{0 , VHost1 }]),
@@ -213,7 +213,7 @@ vhost_failure_forces_connection_closure_on_failure_node(Config) ->
213213 [_Conn21 ] = open_connections (Config , [{1 , VHost2 }]),
214214 ? assertEqual (2 , count_connections_in (Config , VHost2 )),
215215
216- force_vhost_failure (Config , 0 , VHost2 ),
216+ rabbit_ct_broker_helpers : force_vhost_failure (Config , 0 , VHost2 ),
217217 timer :sleep (200 ),
218218 % % Vhost2 connection on node 1 is still alive
219219 ? assertEqual (1 , count_connections_in (Config , VHost2 )),
@@ -236,7 +236,7 @@ dead_vhost_connection_refused_on_failure_node(Config) ->
236236 ? assertEqual (0 , count_connections_in (Config , VHost1 )),
237237 ? assertEqual (0 , count_connections_in (Config , VHost2 )),
238238
239- force_vhost_failure (Config , 0 , VHost2 ),
239+ rabbit_ct_broker_helpers : force_vhost_failure (Config , 0 , VHost2 ),
240240 timer :sleep (200 ),
241241 % % Can open connections to vhost1 on node 0 and 1
242242 [_Conn10 ] = open_connections (Config , [{0 , VHost1 }]),
@@ -257,37 +257,6 @@ dead_vhost_connection_refused_on_failure_node(Config) ->
257257 rabbit_ct_broker_helpers :delete_vhost (Config , VHost2 ),
258258 rabbit_ct_broker_helpers :delete_vhost (Config , VHost1 ).
259259
260- force_vhost_failure (Config , VHost ) -> force_vhost_failure (Config , 0 , VHost ).
261-
262- force_vhost_failure (Config , Node , VHost ) ->
263- force_vhost_failure (Config , Node , VHost , 10 ).
264-
265- force_vhost_failure (_Config , _Node , VHost , 0 ) ->
266- error ({failed_to_force_vhost_failure , no_more_attempts_left , VHost });
267- force_vhost_failure (Config , Node , VHost , Attempts ) ->
268- MessageStorePid = get_message_store_pid (Config , VHost ),
269- rabbit_ct_broker_helpers :rpc (Config , Node ,
270- erlang , exit ,
271- [MessageStorePid , force_vhost_failure ]),
272- % % Give it a time to fail
273- timer :sleep (200 ),
274- case rabbit_ct_broker_helpers :rpc (Config , 0 ,
275- rabbit_vhost_sup_sup , is_vhost_alive ,
276- [VHost ]) of
277- true -> force_vhost_failure (Config , Node , VHost , Attempts - 1 );
278- false -> ok
279- end .
280-
281- get_message_store_pid (Config , VHost ) ->
282- {ok , VHostSup } = rabbit_ct_broker_helpers :rpc (Config , 0 ,
283- rabbit_vhost_sup_sup , vhost_sup , [VHost ]),
284- Children = rabbit_ct_broker_helpers :rpc (Config , 0 ,
285- supervisor , which_children ,
286- [VHostSup ]),
287- [MsgStorePid ] = [Pid || {Name , Pid , _ , _ } <- Children ,
288- Name == msg_store_persistent ],
289- MsgStorePid .
290-
291260cluster_vhost_deletion_forces_connection_closure (Config ) ->
292261 VHost1 = <<" vhost1" >>,
293262 VHost2 = <<" vhost2" >>,
0 commit comments