Skip to content

improve yaml IT infra - #4171

Open
derrickaw wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
derrickaw:20260821_fixFlakyYamlIT
Open

improve yaml IT infra#4171
derrickaw wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
derrickaw:20260821_fixFlakyYamlIT

Conversation

@derrickaw

Copy link
Copy Markdown
Contributor
  1. fix potential resource leak
  2. wait for additional job state of unknown

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.89%. Comparing base (cd5cfcf) to head (192548b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ud/teleport/it/iceberg/IcebergResourceManager.java 16.66% 4 Missing and 1 partial ⚠️
...beam/it/gcp/dataflow/AbstractPipelineLauncher.java 0.00% 1 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (12.50%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@              Coverage Diff              @@
##               main    #4171       +/-   ##
=============================================
+ Coverage     33.88%   55.89%   +22.01%     
- Complexity      503     7473     +6970     
=============================================
  Files           215     1134      +919     
  Lines         13133    70132    +56999     
  Branches       1304     8013     +6709     
=============================================
+ Hits           4450    39203    +34753     
- Misses         8318    28382    +20064     
- Partials        365     2547     +2182     
Components Coverage Δ
spanner-templates 84.63% <ø> (∅)
spanner-import-export 69.01% <ø> (∅)
spanner-live-forward-migration 88.66% <ø> (∅)
spanner-live-reverse-replication 81.26% <ø> (∅)
spanner-bulk-migration 89.06% <ø> (∅)
gcs-spanner-dv 87.85% <ø> (∅)
Files with missing lines Coverage Δ
...beam/it/gcp/dataflow/AbstractPipelineLauncher.java 37.98% <0.00%> (ø)
...ud/teleport/it/iceberg/IcebergResourceManager.java 83.48% <16.66%> (ø)

... and 943 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.

@derrickaw
derrickaw marked this pull request as ready for review August 22, 2026 12:16
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 enhances the stability and resource management of the integration testing infrastructure. By refining the polling logic for Dataflow jobs and ensuring proper disposal of Iceberg catalog resources, the changes improve the reliability of test execution and prevent resource accumulation.

Highlights

  • Dataflow Job Polling: Updated the waitUntilActive method to continue polling when a job is in an UNKNOWN state, ensuring better resilience during job initialization.
  • Resource Management: Implemented automatic closure of the cached Iceberg catalog during cleanup to prevent potential resource leaks.
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.

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.

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

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.

Code Review

This pull request updates the Dataflow pipeline launcher to treat the UNKNOWN job state as pending, and updates the Iceberg resource manager to safely close the cached catalog during cleanup. Regarding the changes in the pipeline launcher, there is a concern that waiting indefinitely on an UNKNOWN state could lead to infinite loops and hang the test suite; it is recommended to implement a timeout or retry limit for this state.

Comment on lines +319 to 322
while (PENDING_STATES.contains(state) || state == JobState.UNKNOWN) {
if (!logOnce) {
LOG.info("Job still pending. Will check again in 15 seconds");
LOG.info("Job still pending or unknown. Will check again in 15 seconds");
logOnce = true;

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.

high

Waiting indefinitely when the job state is UNKNOWN can lead to infinite loops and hang the integration test suite in CI/CD pipelines if the job fails to initialize or is permanently in an unknown state. Consider adding a maximum retry limit or timeout for the UNKNOWN state to prevent potential hangs.

    int unknownStateCount = 0;
    while (PENDING_STATES.contains(state) || state == JobState.UNKNOWN) {
      if (state == JobState.UNKNOWN) {
        unknownStateCount++;
        if (unknownStateCount > 10) {
          throw new RuntimeException("Job state remained UNKNOWN for too long (exceeded 150 seconds).");
        }
      } else {
        unknownStateCount = 0;
      }
      if (!logOnce) {
        LOG.info("Job still pending or unknown. Will check again in 15 seconds");
        logOnce = true;

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.

1 participant