Skip to content

Add test for NothingToQuery when buffer budget exhausted - #1340

Merged
DZakh merged 2 commits into
mainfrom
claude/brave-noether-iuxexl
Jun 23, 2026
Merged

Add test for NothingToQuery when buffer budget exhausted#1340
DZakh merged 2 commits into
mainfrom
claude/brave-noether-iuxexl

Conversation

@DZakh

@DZakh DZakh commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

Add a test case to verify that FetchState.getNextQuery returns NothingToQuery when the buffer budget is exhausted or non-positive.

Changes

  • Added test "Returns NothingToQuery when the buffer budget is exhausted" to FetchState_test.res
  • Test verifies that both zero and negative budgets result in NothingToQuery being returned
  • Uses a single assertion to check both budget scenarios at once, following the convention of checking the whole value in one assert

Details

The test documents the expected behavior that a non-positive budget is the only reason getNextQuery would return NothingToQuery for an initial fetch state, ensuring the shared buffer pool constraints are properly enforced.

https://claude.ai/code/session_01KcQaeMwie245tF3aa5Jkwk

Summary by CodeRabbit

  • Tests
    • Added test coverage for query handling behavior when system resources are exhausted.

Assert getNextQuery returns NothingToQuery for a zero and negative
budget, locking in the `budget <= 0` early return directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcQaeMwie245tF3aa5Jkwk
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3ea5b49e-da75-4708-b73f-69412d565a2e

📥 Commits

Reviewing files that changed from the base of the PR and between 665c173 and f64f68b.

📒 Files selected for processing (1)
  • scenarios/test_codegen/test/lib_tests/FetchState_test.res

📝 Walkthrough

Walkthrough

A new Vitest unit test is added to FetchState_test.res that calls FetchState.getNextQuery with ~budget=0 and ~budget=-5 on a makeInitial() fetch state, asserting both invocations return NothingToQuery.

FetchState Budget Exhaustion Test

Layer / File(s) Summary
getNextQuery returns NothingToQuery on exhausted budget
scenarios/test_codegen/test/lib_tests/FetchState_test.res
Adds a test asserting that getNextQuery produces NothingToQuery when called with non-positive budget values (0 and -5) on an initial fetch state.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main change: adding a test for the NothingToQuery return case when buffer budget is exhausted, which matches the actual changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands.

@DZakh
DZakh enabled auto-merge (squash) June 23, 2026 09:56
@DZakh
DZakh merged commit 62ccd15 into main Jun 23, 2026
8 checks passed
@DZakh
DZakh deleted the claude/brave-noether-iuxexl branch June 23, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants