Repository navigation
fix(tests): make profiler fixture independent of test order (2.0 backport) - #32227
Conversation
…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.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
Code Review ✅ ApprovedBackport that moves profiler workflow execution to OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
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() |
There was a problem hiding this comment.
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
|
✅ Playwright Results — workflow succeededValidated commit ✅ 110 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
* 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]>



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.
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
Reviews (1): Last reviewed commit: "fix(tests): profile in setUpClass so tes..." | Re-trigger Greptile