Skip to content

test(bigtable): fix remaining JSpecify CI issues on Java 8#13834

Merged
lqiu96 merged 2 commits into
mainfrom
fix-jspecify-ci-bigtable-mockito
Jul 20, 2026
Merged

test(bigtable): fix remaining JSpecify CI issues on Java 8#13834
lqiu96 merged 2 commits into
mainfrom
fix-jspecify-ci-bigtable-mockito

Conversation

@lqiu96

@lqiu96 lqiu96 commented Jul 20, 2026

Copy link
Copy Markdown
Member

No description provided.

lqiu96 added 2 commits July 20, 2026 16:32
Disable annotations in Mockito mocks for GAX classes across 17 test
files in `google-cloud-bigtable` to avoid ArrayStoreException on Java 8.
These tests were missed in the previous round of fixes.

TAG=agy
CONV=de3ef09d-a26c-4190-b578-4c993f807bdc
… mocks

Remove `defaultAnswer(Answers.RETURNS_DEEP_STUBS)` from programmatic
mocks of `ServerStreamingCallable` in `BigtableDataClientTests`.
Mockito's deep stubs cause reflection crashes on Java 8 when dealing
with JSpecify annotations. Since the tests do not rely on deep stubs
for these callables, they can be safely removed.

TAG=agy
CONV=de3ef09d-a26c-4190-b578-4c993f807bdc

@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 updates various unit tests across the google-cloud-bigtable module to use Mockito.mock(..., Mockito.withSettings().withoutAnnotations()) instead of standard @Mock annotations or simple Mockito.mock(...) calls. This change prevents Mockito from copying annotations to the mock objects, which helps avoid potential issues with annotation processing or reflection. There are no review comments, so no additional feedback is provided.

@lqiu96
lqiu96 requested a review from mutianf July 20, 2026 17:28
@lqiu96
lqiu96 marked this pull request as ready for review July 20, 2026 17:28
@lqiu96
lqiu96 requested review from a team as code owners July 20, 2026 17:28
@lqiu96
lqiu96 enabled auto-merge (squash) July 20, 2026 17:43
@lqiu96 lqiu96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 20, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 20, 2026
@lqiu96
lqiu96 merged commit 90c2107 into main Jul 20, 2026
221 of 224 checks passed
@lqiu96
lqiu96 deleted the fix-jspecify-ci-bigtable-mockito branch July 20, 2026 18:11
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.

3 participants