Skip to content

Commit

Permalink
Wait until pipeline route is ready to avoid firing pipeline alert (#851)
Browse files Browse the repository at this point in the history
If the pipeline route is tested before it is ready, alert
"Data Science Pipelines Application Route Error Burn Rate" is fired.

This PR adds a sleep and increases the timeout between each test of
the route to avoid it.

Signed-off-by: Jorge Garcia Oncins <[email protected]>
  • Loading branch information
jgarciao authored Jul 11, 2023
1 parent 9e85a17 commit 1dc02cb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ods_ci/libs/DataSciencePipelinesAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def login_and_wait_dsp_route(
count += 1

assert self.route != "", "Route must not be empty"
print(f"DSP route should be working: {self.route}")
print(f"Waiting for Data Science Pipeline route to be ready: {self.route}")
time.sleep(30)
status = -1
count = 0
while status != 200 and count < timeout:
Expand All @@ -94,9 +95,10 @@ def login_and_wait_dsp_route(
# 503 -> service not deployed
# 504 -> service not ready
# if you need to debug, try to print also the response
print(f"({count}): HTTP Status: {status}")
time.sleep(1)
count += 1
print(f"({count}): Data Science Pipeline HTTP Status: {status}")
if status != 200:
time.sleep(30)
count += 30
return status

@keyword
Expand Down

0 comments on commit 1dc02cb

Please sign in to comment.