Skip to content

Commit

Permalink
fix polling
Browse files Browse the repository at this point in the history
  • Loading branch information
LizardWizzard committed Aug 10, 2023
1 parent d7f2abf commit 1235d82
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test_runner/fixtures/pageserver/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,16 @@ def wait_timeline_detail_404(
iterations: int,
):
def timeline_is_missing():
data = {}
try:
data = pageserver_http.timeline_detail(tenant_id, timeline_id)
log.info(f"timeline detail {data}")
except PageserverApiException as e:
log.debug(e)
if e.status_code == 404:
return
raise RuntimeError(f"Timeline exists state {data['state']}") from e

raise RuntimeError(f"Timeline exists state {data.get('state')}")

wait_until(iterations, interval=0.250, func=timeline_is_missing)

Expand Down Expand Up @@ -258,14 +260,16 @@ def wait_tenant_status_404(
iterations: int,
):
def tenant_is_missing():
data = {}
try:
data = pageserver_http.tenant_status(tenant_id)
log.info(f"tenant status {data}")
except PageserverApiException as e:
log.debug(e)
if e.status_code == 404:
return
raise RuntimeError(f"Timeline exists state {data['state']}") from e

raise RuntimeError(f"Timeline exists state {data.get('state')}")

wait_until(iterations, interval=0.250, func=tenant_is_missing)

Expand Down

0 comments on commit 1235d82

Please sign in to comment.