Skip to content

Deflake windows tests.#19511

Merged
jacob314 merged 1 commit intomainfrom
fix_snapshot
Feb 19, 2026
Merged

Deflake windows tests.#19511
jacob314 merged 1 commit intomainfrom
fix_snapshot

Conversation

@jacob314
Copy link
Contributor

@jacob314 jacob314 commented Feb 19, 2026

Summary

Fixes #18499

Details

Revert hack ignoring xterm.js on windows replacing it with a less bad hack to use a larger than reasonable terminal height.

@jacob314 jacob314 requested a review from a team as a code owner February 19, 2026 07:32
@gemini-cli
Copy link
Contributor

gemini-cli bot commented Feb 19, 2026

Hi @jacob314, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this.

We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines.

Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed.

Thank you for your understanding and for being a part of our community!

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jacob314, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses flakiness in Windows tests by refining the terminal rendering utility used in the test suite. The changes aim to standardize how terminal output is captured and asserted, particularly by removing platform-specific workarounds and adjusting terminal buffer dimensions to prevent rendering inconsistencies on Windows.

Highlights

  • Windows Test Stability Improvements: Eliminated a Windows-specific fallback for terminal rendering output, relying solely on the xterm.js buffer for consistency across platforms.
  • Terminal Buffer Size Adjustment: Increased the default number of rows for the test terminal from 40 to 1000 to mitigate rendering issues and incorrect snapshots specifically observed on Windows.
  • Snapshot Updates: Updated several snapshot files (ConfigInitDisplay.test.tsx.snap, ExitPlanModeDialog.test.tsx.snap) to reflect the changes in rendering behavior and ensure test consistency.
Changelog
  • packages/cli/src/test-utils/render.tsx
    • Removed lastRenderStaticContent property and associated Windows-specific rendering logic.
    • Increased the default rows parameter in the render function from 40 to 1000 to prevent rendering issues on Windows.
    • Simplified the expectedFrame calculation in assertOutput by removing reliance on lastRenderStaticContent.
  • packages/cli/src/ui/components/snapshots/ConfigInitDisplay.test.tsx.snap
    • Updated existing snapshot entries and added new ones for truncates list of waiting servers if too many and updates message on McpClientUpdate event.
  • packages/cli/src/ui/components/snapshots/ExitPlanModeDialog.test.tsx.snap
    • Updated existing snapshot entries and added new ones for bubbles up Ctrl+C when feedback is empty while editing and calls onFeedback when feedback is typed and submitted for both useAlternateBuffer states.
Activity
  • The pull request was created by jacob314 with a title indicating the intent to "Deflake windows tests."
  • The description body contains boilerplate sections for summary, details, related issues, validation, and a pre-merge checklist, but no specific human-written content beyond the structure.
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 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 aims to fix flaky tests on Windows by adjusting the test rendering utility. The primary change in packages/cli/src/test-utils/render.tsx increases the headless terminal's row count, which is a pragmatic workaround for platform-specific rendering issues and allows for the removal of a Windows-specific code path. While this change is reasonable, the updated test snapshots reveal a new issue: duplicate test cases are being generated and added. This significantly impacts test suite maintainability and should be addressed by fixing the underlying test structure rather than committing redundant snapshots.

@jacob314 jacob314 enabled auto-merge February 19, 2026 07:35
@gemini-cli gemini-cli bot added priority/p2 Important but can be addressed in a future release. area/core Issues related to User Interface, OS Support, Core Functionality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! labels Feb 19, 2026
@github-actions
Copy link

Size Change: -2 B (0%)

Total Size: 24.5 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 24.5 MB -2 B (0%)
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

@jacob314 jacob314 added this pull request to the merge queue Feb 19, 2026
Merged via the queue into main with commit 082f41f Feb 19, 2026
30 checks passed
@jacob314 jacob314 deleted the fix_snapshot branch February 19, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! priority/p2 Important but can be addressed in a future release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants