Skip to content

Commit 03ef61f

Browse files
authored
fix schedule xfail ut case (#443)
## Summary <!-- Include a short paragraph of the changes introduced in this PR. If this PR requires additional context or rationale, explain why the changes are necessary. --> ## Details <!-- Provide a detailed list of all changes introduced in this pull request. --> - [ ] ## Test Plan <!-- List the steps needed to test this PR. --> - tox -e test -- --runxfail tests/unit/scheduler/test_scheduler.py tox -e test -- --runxfail tests/integration/scheduler/test_scheduler.py tox -e test -- --runxfail tests/unit/test_main.py ## Related Issues <!-- Link any relevant issues that this PR addresses. --> - Resolves # --- - [ ] "I certify that all code in this PR is my own, except as noted below." ## Use of AI - [ ] Includes AI-assisted code completion - [ ] Includes code generated by an AI application - [ ] Includes AI-generated tests (NOTE: AI written tests should have a docstring that includes `## WRITTEN BY AI ##`)
2 parents 9d9392b + 5043a77 commit 03ef61f

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

tests/integration/scheduler/test_scheduler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ async def resolve(self, request: MockRequest, request_info, request_history):
9191
yield f"response_for_{request.payload}", request_info
9292

9393

94-
@pytest.mark.xfail(reason="old and broken", run=False)
9594
@pytest.mark.smoke
9695
@pytest.mark.asyncio
9796
@async_timeout(10.0)
@@ -122,7 +121,7 @@ async def test_scheduler_run_integration(
122121
received_updates = defaultdict(list)
123122
received_responses = []
124123
last_state = None
125-
num_requests = 50
124+
num_requests = 100
126125

127126
async for resp, req, info, state in scheduler.run(
128127
requests=[MockRequest(payload=f"req_{ind}") for ind in range(num_requests)],
@@ -177,4 +176,5 @@ def _request_indices():
177176
assert statuses in (
178177
["queued", "in_progress", "completed"],
179178
["queued", "in_progress", "errored"],
179+
["queued", "pending", "in_progress"],
180180
)

tests/unit/scheduler/test_scheduler.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ def test_initialization(self, valid_instances):
137137
assert id(instance1) == id(instance2)
138138
assert hasattr(instance1, "thread_lock")
139139

140-
@pytest.mark.xfail(reason="old and broken", run=False)
141140
@pytest.mark.smoke
142141
@pytest.mark.asyncio
143142
@async_timeout(10.0)
@@ -164,6 +163,7 @@ async def test_run_basic_functionality(
164163
requests=requests,
165164
backend=backend,
166165
strategy=strategy,
166+
startup_duration=0.1,
167167
env=env,
168168
**constraint_args,
169169
):
@@ -174,7 +174,6 @@ async def test_run_basic_functionality(
174174
assert all(isinstance(r[2], RequestInfo) for r in results)
175175
assert all(isinstance(r[3], SchedulerState) for r in results)
176176

177-
@pytest.mark.xfail(reason="old and broken", run=False)
178177
@pytest.mark.smoke
179178
@pytest.mark.asyncio
180179
@async_timeout(10.0)
@@ -219,7 +218,6 @@ async def test_run_invalid_parameters(self, valid_instances):
219218
):
220219
pass
221220

222-
@pytest.mark.xfail(reason="old and broken", run=False)
223221
@pytest.mark.smoke
224222
@pytest.mark.asyncio
225223
@async_timeout(10.0)

tests/unit/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def test_cli_backend_args_header_removal(mock_benchmark_func, tmp_path: Path):
7777
# Assert that benchmark_with_scenario was called with the correct scenario
7878
mock_benchmark_func.assert_called_once()
7979
call_args = mock_benchmark_func.call_args[1]
80-
scenario = call_args["scenario"]
80+
scenario = call_args["args"]
8181

8282
# Verify the backend_args were merged correctly
8383
backend_args = scenario.backend_kwargs

0 commit comments

Comments
 (0)