Skip to content

Commit 7867c95

Browse files
committed
wip server tests
1 parent b4bf5df commit 7867c95

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@llama.cpp
2+
@num_tokens
3+
Feature: llama.cpp server
4+
5+
Background: Server startup
6+
Given a server listening on localhost:8080
7+
And a model file ../../../test-model.gguf
8+
And a model alias tinyllama-2
9+
And 42 as server seed
10+
And 256 KV cache size
11+
And 2 slots
12+
And -2 max tokens to predict
13+
14+
Then the server is starting
15+
Then the server is healthy
16+
17+
18+
19+
Scenario: Generate tokens until context is full
20+
Then the server is starting
21+
Then the server is healthy
22+
Given a prompt:
23+
"""
24+
Tell me a long story?
25+
"""
26+
And a completion request with no api error
27+
Then 1 tokens are predicted

examples/server/tests/features/steps/steps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def step_start_server(context):
219219
if attempts > max_attempts:
220220
assert False, "server not started"
221221
print(f"waiting for server to start, connect error code = {result}...")
222-
time.sleep(0.1)
222+
time.sleep(0.3)
223223

224224

225225
async def wait_for_server_status_with_timeout(context, expecting_status: Literal['healthy', 'ready', 'idle', 'busy'] | str, timeout: int):
@@ -1343,7 +1343,7 @@ async def wait_for_slots_status(context,
13431343
if 'GITHUB_ACTIONS' in os.environ:
13441344
timeout *= 2
13451345

1346-
async with aiohttp.ClientSession(timeout=DEFAULT_TIMEOUT_SECONDS) as session:
1346+
async with aiohttp.ClientSession(timeout=DEFAULT_TIMEOUT_SECONDS, trust_env=True) as session:
13471347
while True:
13481348
headers = {'Authorization': f'Bearer {context.server_api_key}'}
13491349
async with await session.get(f'{base_url}/slots', params=params, headers=headers) as slots_response:

0 commit comments

Comments
 (0)