Skip to content

test(bigquery): add Storage Write API tests for flaky tables - #6849

Draft
alvarowolfx wants to merge 1 commit into
googleapis:mainfrom
alvarowolfx:impl-bq-write-flaky-tables
Draft

alvarowolfx wants to merge 1 commit into
googleapis:mainfrom
alvarowolfx:impl-bq-write-flaky-tables

Conversation

@alvarowolfx

Copy link
Copy Markdown
Contributor

Add integration tests for BigQuery Storage Write API exercising reconnection and retry behaviors on simulated failure tables in us-east7:

  • _reconnect_on_close: sequential and parallel appends to pending streams
    verifying connection recovery on periodic drops (every 10 requests).
  • _initial_connect_failure: sequential and parallel appends verifying
    retry logic during frequent initial stream connect failures.
  • Default stream appends under simulated connection drops.
  • Stream finalization, commit validation, and row count verification.

Towards ???

@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the BigQuery API. label Sep 17, 2026

@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 introduces flaky write integration tests for the BigQuery Storage Write API, covering sequential and parallel reconnects as well as initial connection failures. The feedback identifies critical issues with the generated table IDs in flaky.rs; the BigQuery test framework in us-east7 requires exact suffixes (_reconnect_on_close and _initial_connect_failure) to trigger simulated flakiness, meaning the parallel and default test table IDs must be adjusted to place their differentiators before these suffixes.

Comment on lines +91 to +94
let table_id = format!(
"{}_reconnect_on_close_parallel",
bigquery_samples::random_id_suffix()
);

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

The table ID ends with _reconnect_on_close_parallel. However, the BigQuery Storage Write API test framework in us-east7 triggers simulated connection drops specifically for tables ending with the exact suffix _reconnect_on_close. Because of this, the table name used here will not trigger the simulated flakiness, and the test will run against a normal table.

Please change the table ID format so that the differentiator is placed before the suffix, ensuring it ends with _reconnect_on_close.

Suggested change
let table_id = format!(
"{}_reconnect_on_close_parallel",
bigquery_samples::random_id_suffix()
);
let table_id = format!(
"{}_parallel_reconnect_on_close",
bigquery_samples::random_id_suffix()
);

Comment on lines +210 to +213
let table_id = format!(
"{}_initial_connect_failure_parallel",
bigquery_samples::random_id_suffix()
);

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

The table ID ends with _initial_connect_failure_parallel. The BigQuery Storage Write API test framework in us-east7 triggers simulated initial connection failures specifically for tables ending with the exact suffix _initial_connect_failure.

Please adjust the table ID format to place the differentiator before the suffix so that it ends with _initial_connect_failure.

Suggested change
let table_id = format!(
"{}_initial_connect_failure_parallel",
bigquery_samples::random_id_suffix()
);
let table_id = format!(
"{}_parallel_initial_connect_failure",
bigquery_samples::random_id_suffix()
);

dataset_id: &str,
schema: TableSchema,
) -> Result<()> {
let table_id = format!("{}_reconnect_default", bigquery_samples::random_id_suffix());

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

The table ID ends with _reconnect_default, but the comment and the test's intent indicate it should target a table with the _reconnect_on_close suffix to simulate connection drops.

Please update the table ID format to end with _reconnect_on_close so that the simulated connection drops are properly triggered.

Suggested change
let table_id = format!("{}_reconnect_default", bigquery_samples::random_id_suffix());
let table_id = format!("{}_default_reconnect_on_close", bigquery_samples::random_id_suffix());

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.18%. Comparing base (e295fe6) to head (f9ef17c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6849   +/-   ##
=======================================
  Coverage   97.18%   97.18%           
=======================================
  Files         328      328           
  Lines      109962   109962           
=======================================
  Hits       106867   106867           
  Misses       3095     3095           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

api: bigquery Issues related to the BigQuery API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant