benchmarks: realworld_llm_benchmark exits 0 when the model is missing (last site of the issue #205 class) - #297
benchmarks: realworld_llm_benchmark exits 0 when the model is missing (last site of the issue #205 class)#297jaylfc wants to merge 1 commit into
Conversation
- benchmarks/realworld_llm_benchmark.py:300: change bare return to sys.exit(1) - tests/test_realworld_llm_benchmark_exit.py: add exit-code non-zero test - changelog.d/tsk-xykcf2-realworld-llm-benchmark.md: record the fix
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review: the production fix is right, the test and the scope claim are notThe one-line change is correct and I want it on master. Red witness, clean. Reverting Two things stop me merging it as it stands. 1. The test only passes because Ollama is absent from CI
Measured, with the positive control in the same run so this is not an ambiguous probe: I monkeypatched So on any machine that actually serves Worth saying plainly, because it is the same trap the PR is fixing: this change exists because a benchmark reported success when its environment was wrong, and its test currently reports success for the same reason. The environment has to be pinned, not inherited. The fix is three lines. Pin the dependency instead of hoping for it: async def test_exit_code_non_zero_when_model_missing(monkeypatch):
async def fake_check_ollama():
return False, []
monkeypatch.setattr(rw, "check_ollama", fake_check_ollama)
with pytest.raises(SystemExit) as exc:
await rw.run_benchmark(limit=1, top_k=1)
assert exc.value.code != 0That still red-witnesses correctly (I checked) and it passes everywhere rather than only where Ollama is missing. 2. "last site of the issue #205 class" is not accurate
and the caller has no exit-code plumbing at all: Both paths print an error and exit 0, which is exactly the #205 shape. PR #290 touched that file with My scan found the site this PR fixes when run against Please do not close issue #205 on this PR. 3. NitsBoth new files are missing a trailing newline ( I am closing this in favour of a revision card rather than leaving it open, for the same reason as #298: a blocked PR has no revision path here, and closing frees the throttle slot and clears the one-PR-per-task guard. The revision card branches from For the record on process: |
|
Closing in favour of the revision card The production fix on this branch is correct and I am not asking for it back. What the revision adds is pinning the test so it stops depending on Ollama being absent, and fixing the two |
CARD TITLE (intent, not commit subject): benchmarks: realworld_llm_benchmark exits 0 when the model is missing (last site of the issue #205 class)
Autonomous build of board card tsk-xykcf2.
Files:
benchmarks/realworld_llm_benchmark.py | 2 +-
changelog.d/tsk-xykcf2-realworld-llm-benchmark.md | 3 +++
tests/test_realworld_llm_benchmark_exit.py | 19 +++++++++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)