Skip to content

fix(tests): make profiler fixture independent of test order (2.0 backport) - #32227

Merged
IceS2 merged 1 commit into
2.0from
backport/31882-profiler-test-2.0
Aug 28, 2026
Merged

IceS2 merged 1 commit into
2.0from
backport/31882-profiler-test-2.0

Conversation

@IceS2

@IceS2 IceS2 commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

Backport of #31882.

This makes the profiler integration fixture self-contained by running profiler workflows during setUpClass, avoiding pytest ordering dependence in test_list_entity_profiles.

Greptile Summary

This backport makes profiler integration data a class fixture so profile-listing assertions no longer depend on test execution order.

  • Runs profiler workflows during class setup.
  • Reuses helper methods for workflow execution and table discovery.
  • Re-profiles after changing global metric settings and strengthens the unfiltered profile-list assertion.

Confidence Score: 4/5

The PR appears safe to merge, although setup-time profiler failures should clean the OpenMetadata fixture state to avoid contaminating later integration tests.

The ordering fix is internally consistent, but the newly added fallible setup step can bypass the service and settings cleanup currently confined to tearDownClass.

Files Needing Attention: ingestion/tests/integration/profiler/test_sqa_profiler.py

Important Files Changed

Filename Overview
ingestion/tests/integration/profiler/test_sqa_profiler.py Removes the test-loader ordering override and makes profiling class-scoped, with a non-blocking cleanup gap if the new setup-time workflow fails.

Reviews (1): Last reviewed commit: "fix(tests): profile in setUpClass so tes..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

…ta (#31882)

pytest orders unittest TestCase methods alphabetically, so
test_list_entity_profiles runs first -- before test_profiler_workflow has
created any profile. The module sets TestLoader.sortTestMethodsUsing = None
to force definition order, but that only affects unittest's own loader:
pytest collects TestCase methods itself and ignores it. Verified against an
unmodified checkout -- collection still yields list_entity_profiles first
with that line in place, so it has never had any effect here.

The test still passed, because it asserts on a global 24h window across
every table rather than on data it owns, and hard-deleted tables used to
leak their profiler rows into that window. #31556 stopped that leak (issue
#27041), and the latent ordering bug surfaced: shard-2 now fails with
"0 not greater than 0" on every PR that actually runs the ingestion
integration matrix, blocking the merge queue. PRs that do not touch
ingestion skip the matrix and report green, which is why this looked
branch-specific rather than repo-wide.

Run the profiler in setUpClass, where fixture data belongs, so no test
depends on another's ordering. Drop the ineffective loader hack, and turn
the `if profiles_all.entities:` guard into an assertion -- that guard
swallowed an empty unfiltered listing and hid which of the two calls was
actually empty, which is the signal needed to diagnose this.
@IceS2
IceS2 requested a review from a team as a code owner August 28, 2026 09:03
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Aug 28, 2026
@gitar-bot

gitar-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Backport that moves profiler workflow execution to setUpClass, making the test fixture self-contained and removing pytest ordering dependence. No issues found.

Options

Display: compact → Showing less information.

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

# not exist yet. It only ever passed because hard-deleted tables used to
# leak their profiler rows into the window it queries (issue #27041, fixed
# in #31556). Profiles are class fixture data, so they belong here.
cls.run_profiler_workflows()

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.

P2 Setup failure skips cleanup

When the profiler workflow fails during setUpClass, the exception handler stops only the containers and class teardown does not run, leaving the created database-service entities and profiler settings in the shared OpenMetadata server to contaminate later integration tests.

Knowledge Base Used: Ingestion workflows

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit ec9425270e67122f6d9ec78fa27e2a66501093bc in Playwright run 33157827990, attempt 1.

✅ 110 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 51m 33s

⏱️ Max setup 3m 7s · max shard execution 12m 40s · max shard-job elapsed before upload 19m 47s · reporting 4s

🌐 212.19 requests/attempt · 1.79 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 212.19 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 1.79 per UI scenario (216 boots / 121 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 46 0 0 0 0 0
✅ Shard ingestion-01 29 0 0 0 0 0
✅ Shard ingestion-02 35 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@IceS2
IceS2 merged commit 4cbb07b into 2.0 Aug 28, 2026
99 of 101 checks passed
@IceS2
IceS2 deleted the backport/31882-profiler-test-2.0 branch August 28, 2026 10:12
harsh-vador added a commit that referenced this pull request Aug 28, 2026
* fix(tests): profile in setUpClass so test_list_entity_profiles has data (#31882) (#32227)

pytest orders unittest TestCase methods alphabetically, so
test_list_entity_profiles runs first -- before test_profiler_workflow has
created any profile. The module sets TestLoader.sortTestMethodsUsing = None
to force definition order, but that only affects unittest's own loader:
pytest collects TestCase methods itself and ignores it. Verified against an
unmodified checkout -- collection still yields list_entity_profiles first
with that line in place, so it has never had any effect here.

The test still passed, because it asserts on a global 24h window across
every table rather than on data it owns, and hard-deleted tables used to
leak their profiler rows into that window. #31556 stopped that leak (issue
#27041), and the latent ordering bug surfaced: shard-2 now fails with
"0 not greater than 0" on every PR that actually runs the ingestion
integration matrix, blocking the merge queue. PRs that do not touch
ingestion skip the matrix and report green, which is why this looked
branch-specific rather than repo-wide.

Run the profiler in setUpClass, where fixture data belongs, so no test
depends on another's ordering. Drop the ineffective loader hack, and turn
the `if profiles_all.entities:` guard into an assertion -- that guard
swallowed an empty unfiltered listing and hid which of the two calls was
actually empty, which is the signal needed to diagnose this.

Co-authored-by: Himanshu Khairajani <[email protected]>

* fix(deps): bump Spring to 7.0.9 (#32222)

Remediates CVE-2026-47886, CVE-2026-59282, and CVE-2026-59283.

* chore(ui): make checkstyle green

---------

Co-authored-by: IceS2 <[email protected]>
Co-authored-by: Himanshu Khairajani <[email protected]>
Co-authored-by: Ram Narayan Balaji <[email protected]>

This branch was previously deployed

1 inactive deployment
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants