Skip to content

test(showcase): add IT against showcase for ResumableUploadCallable - #14244

Draft
whowes wants to merge 1 commit into
mainfrom
whowes/resumable-upload-happy-path-it
Draft

whowes wants to merge 1 commit into
mainfrom
whowes/resumable-upload-happy-path-it

Conversation

@whowes

@whowes whowes commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

For illustration only - this PR will not be merged. This is basically a unit test for the Callable except against the showcase fake rather than mocks. The proper IT for resumable uploads will operate on the client library level rather than the Callable.

@whowes whowes changed the title For illustration only - add IT against showcase for ResumableUploadCallable test(showcase): add IT against showcase for ResumableUploadCallable Sep 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new integration test class, ITResumableUploadCallable, to verify the resumable upload pipeline against Showcase under various scenarios, including single-chunk, multi-chunk, zero-byte uploads, timeouts, and cancellations. The review feedback recommends awaiting the termination of the ScheduledExecutorService during teardown to prevent potential thread leaks.

Comment on lines +174 to +176
if (executor != null) {
executor.shutdownNow();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The ScheduledExecutorService is shut down using shutdownNow(), but its termination is not awaited. To prevent thread leaks and ensure resources are fully released before subsequent tests run, please await the executor's termination. Additionally, ensure that teardown or close methods perform explicit null checks before invoking methods on lazily initialized resources to prevent NullPointerException.

    if (executor != null) {
      executor.shutdownNow();
      executor.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS);
    }
References
  1. When using lazily initialized resources (such as ExecutorService), ensure that teardown or close methods perform explicit null checks before invoking methods on them to prevent NullPointerException.

@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from 04bf956 to 3eb43da Compare September 2, 2026 17:11
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from 3eb43da to 7476681 Compare September 2, 2026 17:12
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch 2 times, most recently from 018d72d to 6362e8a Compare September 2, 2026 19:01
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch 2 times, most recently from 4af6505 to 0566d84 Compare September 2, 2026 20:00
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch 2 times, most recently from 26f77ac to 3d62765 Compare September 2, 2026 22:32
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from 3d62765 to 7e0b084 Compare September 3, 2026 05:29
@whowes
whowes changed the base branch from whowes/resumable-upload-factory to whowes/resumable-upload-settings September 3, 2026 05:36
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch 2 times, most recently from 27e12bd to 4ef352a Compare September 4, 2026 02:44
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch 2 times, most recently from b93f790 to 782059e Compare September 4, 2026 19:46
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from 7e6eec1 to aff0da6 Compare September 5, 2026 00:51
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch 2 times, most recently from e05f31d to 6186690 Compare September 8, 2026 22:15
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from 6186690 to d586d2f Compare September 9, 2026 15:50
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from d586d2f to 49c4acd Compare September 9, 2026 20:16
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from 49c4acd to c86ce04 Compare September 10, 2026 01:14
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from c86ce04 to df4636e Compare September 10, 2026 18:34

@blakeli0 blakeli0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really like the idea of testing against showcase with callables directly. Never did it before but we should definitely try it more often in the future. Especially with the help of AI, the cost of writing these tests are almost none.

@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from df4636e to 9c56fdd Compare September 11, 2026 07:45
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from 9c56fdd to 9277706 Compare September 11, 2026 17:23
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from 9277706 to 259914b Compare September 11, 2026 19:59
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from 259914b to 858debf Compare September 11, 2026 21:13
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from 858debf to c7dcc24 Compare September 11, 2026 21:49
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from c7dcc24 to 2d16cc6 Compare September 14, 2026 21:33
Base automatically changed from whowes/resumable-upload-settings to main September 14, 2026 23:13
Add integration tests against local GAPIC Showcase server for
ResumableUploadCallable, validating:
1. Single-chunk upload happy path.
2. Multi-chunk upload with multiple intermediate chunks and final chunk.
3. 0-byte upload and exact-chunk uploads with separate 0-byte finalize request.
4. Future cancellation and timeout handling.
5. Convenience futureCall(request, stream) overload.
6. Per-request ApiCallContext extra header overrides.
7. Stub-level and per-request ResumableUploadCallSettings overrides.
8. Stub-level and per-request global timeout watchdog triggering DeadlineExceededException.
@whowes
whowes force-pushed the whowes/resumable-upload-happy-path-it branch from 2d16cc6 to 3911e8a Compare September 14, 2026 23:13
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