Skip to content

fix(sql_connect): e2e listen test refactor - #18496

Merged
aashishpatil-g merged 1 commit into
mainfrom
ap/fixE2ETest
Jul 30, 2026
Merged

fix(sql_connect): e2e listen test refactor#18496
aashishpatil-g merged 1 commit into
mainfrom
ap/fixE2ETest

Conversation

@aashishpatil-g

@aashishpatil-g aashishpatil-g commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The e2e listen test for subscription cancels is failing. This PR refactors that test case.

Summary of Improvements Made by Antigravity

Eliminated Unhandled Exception Risks: Added completion checks (!listenerXReady.isCompleted, !listenerXReceivedUpdate.isCompleted) so multiple stream emissions will never throw StateError: Bad state: Future already completed.

Synchronized Readiness for Both Listeners: Used Future.wait([listener1Ready.future, listener2Ready.future]) to guarantee both subscriptions process initial setup before performing mutations.

Removed Arbitrary Future.delayed Sleep: Replaced the 5-second sleep with a deterministic Completer (listener2ReceivedUpdate.future) to prevent test flakiness and speed up execution.

Added Timeout Protection: Wrapped all awaited futures with .timeout(_listenTimeout) to prevent test hanging if a stream fails to emit.

Added Refetch Trigger for 2nd Movie: Added await MoviesConnector.instance.listMovies().ref().execute(); after creating Raiders of the Lost Arc to guarantee the query update is triggered for active stream subscribers.

Guaranteed Stream Cleanup: Placed resource cancellations inside a try ... finally block so both subscriptions are properly disposed of even if an assertion fails.

@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 馃憤 and 馃憥 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@aashishpatil-g aashishpatil-g changed the title fix(sql_connect): e2e listen test fix(sql_connect): e2e listen test refactor Jul 29, 2026
@aashishpatil-g
aashishpatil-g merged commit e512d39 into main Jul 30, 2026
40 of 41 checks passed
@aashishpatil-g
aashishpatil-g deleted the ap/fixE2ETest branch July 30, 2026 14:05
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