Repository navigation
Conversation
chikamura
marked this pull request as ready for review
October 14, 2026 02:56
2 tasks done
john-abre
approved these changes
Oct 14, 2026
There was a problem hiding this comment.
Approve します。#126 で挙げた非ブロッキングの 6 点がすべて反映されています。
assertNoMore() の呼び出しは残っておらず、try-with-resources の外でカーソルを持つのは、失敗自体を検証するハーネスのセルフテスト 2 件だけであることを確認しました。
挙動も問題ありません: try 本体の失敗が優先されて close() の失敗は suppressed として付き、リクエストが少ない run は最初の next() で、多い run は close() が余分なリクエストを名指しして失敗します。セルフテストが両方向をカバーしています。
手元でも ./gradlew spotlessCheck test を実行し、158 テスト(1 skip)がすべて通りました。
🤖 Generated with Claude Code
chikamura
force-pushed
the
ruby-compat/test-infra-request-cursor
branch
from
October 15, 2026 00:10
5fca3e9 to
0a3e564
Compare
chikamura
force-pushed
the
ruby-compat/test-infra-request-cursor-followup
branch
from
October 15, 2026 00:10
4e9f532 to
f81c7ef
Compare
Base automatically changed from
ruby-compat/test-infra-request-cursor
to
feature/ruby-compatibility
October 15, 2026 00:11
runWithMockServer() compared the request count to the response count before the test could walk a single request, so a step that gained or lost a call failed with a bare "expected:<10> but was:<9>" and the cursor never got to say where. The count check is gone: the cursor is handed every recorded request, a run that made fewer calls fails at the first next() with nothing left, and one that made more fails at assertNoMore(), whose message now lists the unasserted requests as "GET /path" (the 599 fail-fast answer usually fails the action before that). The harness self-tests cover both directions. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Completeness depended on each test remembering to end with requests.assertNoMore(); a forgotten call would have silently brought back the partial-assertion mode in which the strftime test skipped requests (#112 / #119). RequestCursor is now AutoCloseable and close() does that check, so tests hold the cursor in a try-with-resources and nothing is left to remember. A failure in the try body still wins: the close() failure is attached to it as suppressed. The harness self-tests for a run that made too many or too few requests keep the cursor outside a try on purpose, since they assert on the failure itself (close() naming "GET /two", next() with nothing left). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
testRunAppendDirectMode and its no-compression twin re-implemented the helper inline because it returned only the POST that opens the session, and they also need the file PUT to check the uploaded bytes. The helper now returns a LoadAttempt holding both, so those two tests use it as well and a change to what one attempt consists of (#123) lands in one place. Callers that only wanted the POST read .openUpload off the result. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
RequestCursor#next() printed position twice; at the point it fails position equals the recorded count, so the message read "after 9 ... only 9". It now says which request (counting from 1, like the test's response list) the test is asserting and how many were recorded. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
chikamura
force-pushed
the
ruby-compat/test-infra-request-cursor-followup
branch
from
October 15, 2026 00:13
f81c7ef to
30ea515
Compare
10 of 21 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #126, addressing the non-blocking suggestions in its review (#126 (review)). #126 itself stays at the approved commit; this PR is stacked on it and carries only the changes below. Test code only.
runWithMockServer()compared the request count to the response count before the test could walk a single request, so a step that gained or lost a call failed with a bareexpected:<10> but was:<9>and the cursor never got to say where. The count check is gone: the cursor is handed every recorded request, a run that made fewer calls fails at the firstnext()with nothing left, and one that made more fails when the cursor is closed, whose message now lists the unasserted requests asGET /path(the 599 fail-fast answer usually fails the action before that). The harness self-tests cover both directions.RequestCursorisAutoCloseableandclose()checks that every request was walked, so tests hold the cursor in a try-with-resources; the explicitassertNoMore()calls are gone. A failure in the try body still wins: theclose()failure is attached to it as suppressed. The two harness self-tests for a run that made too many or too few requests keep the cursor outside a try on purpose, since they assert on the failure itself.assertLoadAttempt()returns both upload requests. It returns aLoadAttemptholding the session-open POST and the file PUT, sotestRunAppendDirectModeand its no-compression twin use it instead of re-implementing it inline, and a change to what one attempt consists of ([ruby-compat/07] Fail fast instead of swallowing data-loss errors #123) lands in one place. Callers that only want the POST read.openUploadoff the result.next()says which request the test asserts. The failure message read "after 9 ... only 9" (position printed twice); it now says "the test asserts request Retry for bq transfer #10 but the run recorded only 9", counting from 1 like the test's response list.runWithMockServer()comment no longer has a short line; it was rewritten with the first item.Test plan
./gradlew test(158 tests, 1 skipped)./gradlew spotlessApply🤖 Generated with Claude Code