Skip to content

Commit

Permalink
Merge branch 'master' into pkg-filter-testify
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Sep 30, 2021
2 parents f432861 + 2331549 commit 530ad5f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/http_api/util/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ def pause_changefeed():
resp = rq.post(url)
if resp.status_code == rq.codes.accepted:
break
time.sleep(1)
assert resp.status_code == rq.codes.accepted
# check if pause changefeed success
url = BASE_URL+"/changefeeds/changefeed-test2"
for i in range(RETRY_TIME):
time.sleep(1)
resp = rq.get(url)
assert resp.status_code == rq.codes.ok
data = resp.json()
if data["state"] == "stopped":
break
time.sleep(1)
assert data["state"] == "stopped"

# test pause changefeed failed
url = BASE_URL+"/changefeeds/changefeed-not-exists/pause"
resp = rq.post(url)
Expand Down Expand Up @@ -146,12 +146,12 @@ def resume_changefeed():
# check if resume changefeed success
url = BASE_URL+"/changefeeds/changefeed-test2"
for i in range(RETRY_TIME):
time.sleep(1)
resp = rq.get(url)
assert resp.status_code == rq.codes.ok
data = resp.json()
if data["state"] == "normal":
break
time.sleep(1)
assert data["state"] == "normal"

# test resume changefeed failed
Expand All @@ -173,11 +173,10 @@ def remove_changefeed():
# check if remove changefeed success
url = BASE_URL+"/changefeeds/changefeed-test3"
for i in range(RETRY_TIME):
time.sleep(1)
resp = rq.get(url)
if resp.status_code == rq.codes.bad_request:
break

time.sleep(1)
assert resp.status_code == rq.codes.bad_request
assert resp.json()["error_code"] == "CDC:ErrChangeFeedNotExists"

Expand Down Expand Up @@ -258,10 +257,10 @@ def get_processor():
def check_health():
url = BASE_URL + "/health"
for i in range(RETRY_TIME):
time.sleep(1)
resp = rq.get(url)
if resp.status_code == rq.codes.ok:
break
time.sleep(1)
assert resp.status_code == rq.codes.ok

print("pass test: check health")
Expand Down

0 comments on commit 530ad5f

Please sign in to comment.