Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci]try to fix flaky multi-step tests #11894

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions tests/multi_step/test_correctness_async_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
NUM_PROMPTS = [10]

DEFAULT_SERVER_ARGS: List[str] = [
"--disable-log-requests",
"--worker-use-ray",
"--gpu-memory-utilization",
"0.85",
Expand Down Expand Up @@ -110,7 +109,7 @@ async def test_multi_step(

# Spin up client/server & issue completion API requests.
# Default `max_wait_seconds` is 240 but was empirically
# was raised 3x to 720 *just for this test* due to
# was raised 5x to 1200 *just for this test* due to
# observed timeouts in GHA CI
ref_completions = await completions_with_server_args(
prompts,
Expand Down
9 changes: 7 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,19 @@ def url_root(self) -> str:
def url_for(self, *parts: str) -> str:
return self.url_root + "/" + "/".join(parts)

def get_client(self):
def get_client(self, **kwargs):
if "timeout" not in kwargs:
kwargs["timeout"] = 60
return openai.OpenAI(
base_url=self.url_for("v1"),
api_key=self.DUMMY_API_KEY,
max_retries=0,
**kwargs,
)

def get_async_client(self, **kwargs):
if "timeout" not in kwargs:
kwargs["timeout"] = 60
return openai.AsyncOpenAI(base_url=self.url_for("v1"),
api_key=self.DUMMY_API_KEY,
max_retries=0,
Expand Down Expand Up @@ -780,7 +786,6 @@ async def completions_with_server_args(
assert len(max_tokens) == len(prompts)

outputs = None
max_wait_seconds = 240 * 3 # 240 is default
with RemoteOpenAIServer(model_name,
server_cli_args,
max_wait_seconds=max_wait_seconds) as server:
Expand Down
Loading