Skip to content

Commit

Permalink
Deflake Serve tests (#12542)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-mo committed Dec 1, 2020
1 parent 4288b5b commit 7022278
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions ci/travis/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ test_python() {
args+=(
python/ray/serve/...
python/ray/tests/...
-python/ray/serve:test_api # segfault on windows? https://github.com/ray-project/ray/issues/12541
-python/ray/tests:test_advanced_2
-python/ray/tests:test_advanced_3 # test_invalid_unicode_in_worker_log() fails on Windows
-python/ray/tests:test_autoscaler_aws
Expand Down
11 changes: 10 additions & 1 deletion python/ray/serve/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,16 @@ def function2(_):
client.create_backend("delete:v1", function2)
client.set_traffic("delete_backend", {"delete:v1": 1.0})

assert requests.get("http://127.0.0.1:8000/delete-backend").text == "olleh"
for _ in range(10):
try:
assert requests.get(
"http://127.0.0.1:8000/delete-backend").text == "olleh"
break
except AssertionError:
time.sleep(0.5) # wait for the traffic policy to propogate
else:
assert requests.get(
"http://127.0.0.1:8000/delete-backend").text == "olleh"


@pytest.mark.parametrize("route", [None, "/delete-endpoint"])
Expand Down

0 comments on commit 7022278

Please sign in to comment.