Skip to content

Fix nightly ingestion integration tests and a flaky Alation sink unit test - #37097

Merged
harshsoni2024 merged 2 commits into
mainfrom
ulixius9/failing-integration-tests-fix
Nov 5, 2026
Merged

harshsoni2024 merged 2 commits into
mainfrom
ulixius9/failing-integration-tests-fix

Conversation

@ulixius9

@ulixius9 ulixius9 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes the nightly py-cli-e2e-tests failures in run 41938450661: the two setup errors in ometa/test_ometa_ingestion_pipeline.py and the failure in usage/test_sample_usage.py::QueryParserTest::test_join_count.

  • ometa workflow fixture. The fixture builds a MysqlConnection without type, and model_dump_json drops unset fields. That leaves the untagged DatabaseConnection union with no discriminator. Since Fixes 36674: Add default system-schema filters for database connectors #36677 gave Trino default filter patterns, the union resolves to TrinoConnection, so MysqlSource.create raises Expected MysqlConnection, but got type=Trino. The fix sets type=MySQLType.Mysql. This only affects tests: real connection JSON always carries type, and Trino rejects "Mysql".

  • test_sample_usage. sample_data is a BigQuery service. Since Fixes 16640: Add stable BigQuery shard families #36867, BigQuery usage resolution (prepare_usage) rewrites each table reference to the matched table's FQN without the service prefix, so stage keys are now ecommerce_db.shopify.<table>. The expected keys are updated and the counts are unchanged. The test now asserts the whole map, so a miss reports what was found instead of False is not true.

  • Flaky alationsink/test_client.py clock tests (failed this PR's 3.10 unit job). patch("…client.time.monotonic") replaces the attribute on the global time module. A leftover pymongo background thread then used up the fake clock ticks, and the resulting StopIteration surfaced as an empty error string. The tests now patch only the client module's time binding.

Type of change:

  • Bug fix

High-level design:

N/A — test-only fix to two files.

Tests:

Use cases covered

  • The ometa ingestion-pipeline tests get a MySQL workflow from a Python-built MysqlConnection.
  • Sample usage ingestion against the BigQuery sample_data service counts usage under resolved table names.

Unit tests

  • tests/unit/source/metadata/alationsink/: 18 passed.
  • Race check: with a background thread calling time.monotonic() throughout, the old file failed 3/3 runs with CI's signature and the fixed file passed 3/3.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Files updated: ingestion/tests/integration/ometa/conftest.py, ingestion/tests/integration/usage/test_sample_usage.py
  • Not run against a live server: no local OpenMetadata stack or Docker was available. Each failure was instead reproduced and fixed offline:
    • Parsing the fixture's dumped MysqlConnection through WorkflowSource gives TrinoConnection without type and MysqlConnection with it.
    • Running the real sample_data query log through parse_sql_statement and BigQueryTableBindingResolution.prepare_usage (catalog search stubbed) gives exactly the new expected map, {raw_product_catalog: 6, dim_customer: 4, fact_order: 4, fact_sale: 5, raw_customer: 11} under ecommerce_db.shopify..
  • The full suite runs in the merge queue and nightly.

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

  1. Pulled the failing job log and traced each failure to its cause (Fixes 36674: Add default system-schema filters for database connectors #36677 Trino defaults; Fixes 16640: Add stable BigQuery shard families #36867 BigQuery usage resolution). The usage test was already failing on the Nov 4 nightly.
  2. Ran the offline reproductions above.
  3. ruff check and ruff format --check pass on both files.

UI screen recording:

Not applicable — test-only change.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation> — N/A, test fix with no issue (skip-pr-checks).
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above. — N/A, test fix.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. — N/A
  • For a UI feature or feature task: … — N/A
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md and fixed every 🔴 finding, or answered it on the line below.
    • Reviewed f4c6f2d0626; no 🔴 findings.
  • Decision check: no durable decision in this PR.

🤖 Generated with Claude Code

…and BigQuery usage resolution

- ometa workflow fixture: set MysqlConnection.type explicitly. The dump
  excludes unset fields, so without the discriminator the untagged
  DatabaseConnection union resolved to TrinoConnection once Trino gained
  default filter patterns (#36677).
- test_sample_usage: sample_data is a BigQuery service, and BigQuery usage
  resolution (#36867) rewrites references to database.schema.table, so
  expect those keys. Assert the whole map so a miss shows what was found.
@ulixius9
ulixius9 requested a review from a team as a code owner November 5, 2026 05:27
@ulixius9 ulixius9 added the skip-pr-checks Bypass PR metadata validation check label Nov 5, 2026
Copilot AI balanced review requested due to automatic review settings November 5, 2026 05:27

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Nov 5, 2026
…onic

Patching `client.time.monotonic` replaces the attribute on the shared `time`
module, so any background thread (a leftover pymongo cursor reaper on the 3.10
unit job) consumed the fake ticks; the exhausted iterator raised StopIteration,
which _write_batch reported as an empty error. Patch the client module's `time`
binding instead.
Copilot AI balanced review requested due to automatic review settings November 5, 2026 06:33
@ulixius9 ulixius9 changed the title Fix nightly ingestion integration tests (ometa MySQL fixture, sample usage keys) Fix nightly ingestion integration tests and a flaky Alation sink unit test Nov 5, 2026

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@gitar-bot

gitar-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟢 Low risk · Changes are confined to ingestion test fixtures, expected usage keys, and clock mocking, with no production code or interfaces changed.

Fixes nightly ingestion integration tests by setting type=MySQLType.Mysql on the ometa workflow fixture's MysqlConnection and updating expected stage keys in usage/test_sample_usage.py for BigQuery table FQN resolution, and patches only the Alation sink client's time binding to remove a flaky clock test. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@harshsoni2024
harshsoni2024 merged commit deb806c into main Nov 5, 2026
67 of 68 checks passed
@harshsoni2024
harshsoni2024 deleted the ulixius9/failing-integration-tests-fix branch November 5, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants