Skip to content

Comments

[SpannerToSourceDb] Fixing flaky test SpannerToMySqlDataTypesIT#3379

Merged
darshan-sj merged 1 commit intoGoogleCloudPlatform:mainfrom
darshan-sj:spanner-it
Feb 19, 2026
Merged

[SpannerToSourceDb] Fixing flaky test SpannerToMySqlDataTypesIT#3379
darshan-sj merged 1 commit intoGoogleCloudPlatform:mainfrom
darshan-sj:spanner-it

Conversation

@darshan-sj
Copy link
Contributor

Fixing a flaky test - SpannerToMySqlDataTypesIT

The test was using ChainedConditionCheck and chaining 23 conditions. Chained condition check executes checks one after the other with 15 seconds wait in between. Hence, even if all the underlying 23 conditions were satisfied, the whole condition check was taking 23*15 = 345 secs ~ 6 mins. and hence we were hitting timeout.

Changed the condition check to use "AND" condition instead of using chained condition. "AND" condition doesn't put waits in between.

@gemini-code-assist
Copy link

Summary of Changes

Hello @darshan-sj, 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 a critical issue with a flaky integration test, SpannerToMySqlDataTypesIT, by optimizing its condition evaluation logic. The change prevents test timeouts and improves the reliability of the test suite by replacing a time-consuming sequential condition check with a more efficient parallel evaluation approach.

Highlights

  • Flaky Test Fix: The SpannerToMySqlDataTypesIT test was identified as flaky due to timeouts. This was caused by the use of ChainedConditionCheck, which sequentially executed 23 conditions with 15-second waits between each, resulting in a total wait time of approximately 6 minutes and exceeding the test timeout.
  • Condition Check Logic Update: The test's condition checking mechanism has been refactored to use a single ConditionCheck with an "AND" logical operation. This change eliminates the sequential waits between conditions, significantly reducing the test execution time and resolving the timeout issue.
Changelog
  • v2/spanner-to-sourcedb/src/test/java/com/google/cloud/teleport/v2/templates/SpannerToMySqlDataTypesIT.java
    • Removed the import statement for ChainedConditionCheck.
    • Updated the buildConditionCheck method signature to return ConditionCheck instead of ChainedConditionCheck.
    • Refactored the condition building logic within buildConditionCheck to combine conditions using ConditionCheck.and().
    • Removed the previous logic that grouped conditions for ChainedConditionCheck.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
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.

@darshan-sj darshan-sj marked this pull request as ready for review February 19, 2026 07:11
@darshan-sj darshan-sj requested a review from a team as a code owner February 19, 2026 07:11
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.01%. Comparing base (c2dd712) to head (89bd87c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3379      +/-   ##
============================================
- Coverage     51.05%   51.01%   -0.04%     
- Complexity     5212     5249      +37     
============================================
  Files           994     1005      +11     
  Lines         60723    60914     +191     
  Branches       6657     6658       +1     
============================================
+ Hits          31000    31076      +76     
- Misses        27543    27656     +113     
- Partials       2180     2182       +2     
Components Coverage Δ
spanner-templates 70.59% <100.00%> (-0.26%) ⬇️
spanner-import-export 68.91% <ø> (-0.02%) ⬇️
spanner-live-forward-migration 79.82% <ø> (-0.02%) ⬇️
spanner-live-reverse-replication 77.36% <ø> (-0.02%) ⬇️
spanner-bulk-migration 87.98% <ø> (-0.02%) ⬇️
gcs-spanner-dv 83.79% <100.00%> (-1.96%) ⬇️
see 11 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@darshan-sj darshan-sj merged commit 27bb017 into GoogleCloudPlatform:main Feb 19, 2026
23 of 25 checks passed
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.

2 participants