Skip to content

Conversation

daymxn
Copy link
Member

@daymxn daymxn commented Oct 16, 2025

The interrupt test is flakey, as it relies on a bit of timing. If the network is having issues, the model may finish generating and processing data before the client has time to interrupt. To help circumvent this, I've implemented a retry function for retrying the test 3 times, with a 2 second delay between each attempt.

There may be a better solution though, such as a longer audio clip (to give us more time), or some form of system instructions. If this test continues to be flakey, even under the retry infrastructure, then we may want to explore said alternatives.

#no-changelog

@daymxn daymxn requested review from andrewheard and ncooke3 October 16, 2025 17:55
@daymxn daymxn self-assigned this Oct 16, 2025
Copy link
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

Customization

To customize 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 counter productive. 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.

Copy link
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 introduces a retry mechanism to handle a flaky interrupt test, which is a good approach to improve test stability. The implementation of the retry utility function is solid, though I have a couple of minor suggestions to enhance its robustness. The main feedback is on the usage of this new retry function in LiveSessionTests.swift, where the current implementation doesn't correctly trigger retries on failure and could be more efficient by moving pre-test checks outside the retry loop. The suggested changes aim to make the retry logic work as intended.

@daymxn daymxn requested a review from andrewheard October 17, 2025 15:26
Copy link
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 introduces a retry utility function to handle a flaky interrupt test, which is a good approach to improve test stability. The implementation of the retry function is solid, and its application in realtime_interruption is correct. I've added a couple of minor suggestions for code improvements, one related to using a more idiomatic Swift precondition check and another to improve the structure of the test code by moving a local type definition out of a loop. Overall, these are good changes that should help with the test flakiness.

Copy link
Contributor

@andrewheard andrewheard left a comment

Choose a reason for hiding this comment

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

LGTM. Please address the Gemini NoInterruptionError recommendation. I think the precondition one is super low priority.

Thanks for adding this! Eventually I'd like to refactor this as a a Swift Testing Trait but I've never had time to fully investigate and this approach should work just as well for our needs right now.

Copy link
Member

@ncooke3 ncooke3 left a comment

Choose a reason for hiding this comment

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

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants