File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 1- use crate :: common:: runtime:: { block_on, tokio_runtime} ;
1+ use crate :: common:: {
2+ retry:: retry,
3+ runtime:: { block_on, tokio_runtime} ,
4+ } ;
25
36use super :: tools:: {
47 k8s_env:: K8sEnv ,
@@ -189,8 +192,15 @@ agents:
189192
190193 // Expect that the current_agent and secret to be removed on the second call.
191194 gc. collect ( ) . unwrap ( ) ;
192- block_on ( api_foo. get ( resource_name) ) . expect_err ( "CR should be removed" ) ;
193- block_on ( api_secret. get ( secret_name) ) . expect_err ( "Secret should be removed" ) ;
195+ retry ( 60 , Duration :: from_secs ( 1 ) , || {
196+ if block_on ( api_foo. get ( resource_name) ) . is_ok ( ) {
197+ return Err ( "CR should be removed" . into ( ) ) ;
198+ } ;
199+ if block_on ( api_secret. get ( secret_name) ) . is_ok ( ) {
200+ return Err ( "Secret should be removed" . into ( ) ) ;
201+ } ;
202+ Ok ( ( ) )
203+ } ) ;
194204 assert_ne ! (
195205 agent_instance_id,
196206 instance_id_getter. get( agent_id) . unwrap( ) ,
You can’t perform that action at this time.
0 commit comments