File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change 1414
1515LOG : logging .Logger = logging .getLogger (__name__ )
1616
17- WAIT_SECONDS = 5
18- WAIT_ATTEMPTS = 10
17+ MAX_WAIT_ATTEMPTS = 25
1918
2019
2120def fullSetupDockerCompose () -> DockerCompose :
@@ -65,19 +64,26 @@ def test_smoke(self) -> None:
6564 # wait for channels to sync
6665 LOG .info ("CF URL: %s" , cf_url )
6766 cf_client = ChannelFinderClient (BaseURL = cf_url )
68- for number_of_seconds in range (WAIT_ATTEMPTS ):
67+ self .wait_for_sync (cf_client )
68+ channels = cf_client .find (name = "*" )
69+ assert len (channels ) == 24
70+ assert channels [0 ]["name" ] == "IOC1-1::li"
71+
72+ def wait_for_sync (self , cf_client ):
73+ seconds_to_wait = 1
74+ total_seconds_waited = 0
75+ for _ in range (MAX_WAIT_ATTEMPTS ):
6976 try :
7077 channels = cf_client .find (name = "*" )
7178 LOG .info (
7279 "Found %s in %s seconds" ,
7380 len (channels ),
74- number_of_seconds * WAIT_SECONDS ,
81+ total_seconds_waited ,
7582 )
7683 if len (channels ) == 24 :
7784 break
7885 except Exception as e :
7986 LOG .error (e )
80- time .sleep (WAIT_SECONDS )
81- channels = cf_client .find (name = "*" )
82- assert len (channels ) == 24
83- assert channels [0 ]["name" ] == "IOC1-1::li"
87+ time .sleep (seconds_to_wait )
88+ total_seconds_waited += seconds_to_wait
89+ seconds_to_wait *= 2
You can’t perform that action at this time.
0 commit comments