Skip to content

test(spanner): deflake multiplexed session mock tests and skip ITInstanceAdminTest in staging/devel#13020

Merged
sakthivelmanii merged 1 commit intomainfrom
deflake-mock-test-and-skip-instance-admin-test
May 6, 2026
Merged

test(spanner): deflake multiplexed session mock tests and skip ITInstanceAdminTest in staging/devel#13020
sakthivelmanii merged 1 commit intomainfrom
deflake-mock-test-and-skip-instance-admin-test

Conversation

@sakthivelmanii
Copy link
Copy Markdown
Contributor

No description provided.

@sakthivelmanii sakthivelmanii requested review from a team as code owners May 6, 2026 09:38
Copy link
Copy Markdown
Contributor

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

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 refactors tests in MultiplexedSessionDatabaseClientMockServerTest.java by consolidating test logic and adding request count assertions, and updates ITInstanceAdminTest.java to skip execution in development and staging environments. Feedback suggests that the refactored test is missing explicit multiplexed session flags in its configuration and lacks the necessary code to verify the expected DEADLINE_EXCEEDED exception.

Comment on lines +116 to +117
.setSessionPoolOption(
SessionPoolOptions.newBuilder().setFailOnSessionLeak().build())
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 SessionPoolOptions configuration is missing the flags to enable multiplexed sessions (e.g., setUseMultiplexedSession(true)). Since this test class is specifically designed to test multiplexed session behavior, these flags should be explicitly set to ensure the test is valid and consistent with the deleted testRetryWithNoSessionCreationWaitTime test.

            .setSessionPoolOption(
                SessionPoolOptions.newBuilder()
                    .setUseMultiplexedSession(true)
                    .setUseMultiplexedSessionForRW(true)
                    .setUseMultiplexedSessionPartitionedOps(true)
                    .setFailOnSessionLeak()
                    .build())

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.

Multiplexed sessions are enabled by default.

Comment on lines 123 to 124
// The first attempt should lead to a DEADLINE_EXCEEDED error being propagated from the
// CreateSession attempt.
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 comment states that the first attempt should result in a DEADLINE_EXCEEDED error, but the code to perform this attempt and verify the exception (e.g., using assertThrows) is missing from the patch. This verification is crucial for testing the retry logic and was present in the deleted test testRetryWithNoSessionCreationWaitTime.

References
  1. Use Assertions.assertThrows if the exception is truly expected as part of the test scenario.

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.

This comment was not added in this test, and as such this review comment is a bit weird. And in addition: The assertThrows is one line below this comment....

Comment on lines +116 to +117
.setSessionPoolOption(
SessionPoolOptions.newBuilder().setFailOnSessionLeak().build())
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.

Multiplexed sessions are enabled by default.

Comment on lines 123 to 124
// The first attempt should lead to a DEADLINE_EXCEEDED error being propagated from the
// CreateSession attempt.
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.

This comment was not added in this test, and as such this review comment is a bit weird. And in addition: The assertThrows is one line below this comment....

@sakthivelmanii sakthivelmanii force-pushed the deflake-mock-test-and-skip-instance-admin-test branch from d22899e to 6f2d550 Compare May 6, 2026 09:48
@sakthivelmanii sakthivelmanii merged commit 2312aae into main May 6, 2026
130 of 131 checks passed
@sakthivelmanii sakthivelmanii deleted the deflake-mock-test-and-skip-instance-admin-test branch May 6, 2026 10:11
@jinseopkim0 jinseopkim0 added the release-please:force-run To run release-please label May 6, 2026
@release-please release-please Bot removed the release-please:force-run To run release-please label May 6, 2026
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