Repository navigation
fix(tests): profile in setUpClass so test_list_entity_profiles has data - #31882
Conversation
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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ ApprovedMoves profiler workflow execution to setUpClass in TestSQAProfiler to ensure entity profiles exist before test execution, fixing test ordering dependencies. No issues found. 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 |
✅ 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) 26m 40s ⏱️ Max setup 4m 43s · max shard execution 10m 29s · max shard-job elapsed before upload 16m 17s · reporting 4s 🌐 216.15 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) 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. * fix(ui): make whole Domain and Data Product rows clickable (#31876) * fix(ui): make whole Domain and Data Product rows clickable * addressed comments * Added unit test for the fix * test(playwright): fix five AUT nightly flakes at their cause Collate's AUT nightly run 32476747983 retried 25 tests on each database lane. Fourteen of the distinct specs live here. These five have a cause the artifacts explain; the rest are listed below rather than guessed at. Lineage node clicks (LineageInteraction, both lanes) clickLineageNode clicked the node the moment the caller's getLineage wait returned. React Flow mounts nodes in its own layout pass after that, so the click auto-waited with no timeout of its own and the spec died as a bare "Test timeout of 60000ms exceeded" naming nothing. Assert the node is visible first. Ingestion wizard Next (ServiceIngestion) Creating the service triggers AutoPilot, whose toast renders bottom-center — over the wizard footer. The trace shows the click on next-button intercepted by the toast's own alert-message span, then auto-waiting until the test timed out. Wait for that toast to dismiss before advancing. Knowledge Center owner chip (ExplorePageRightPanel_KnowledgeCenter, both lanes) The Explore summary panel renders owners from the search document, refreshed asynchronously after the owner PATCH. A panel that rendered before the refresh will never show the chip, so the 60s wait was waiting on the wrong thing. Re-open the entity until it is there. Glossary hierarchy modal (GlossaryHierarchy) getByLabel('Select Parent') is page-scoped and also matches the control of a hierarchy modal an earlier step left in the DOM; the click then spent the whole test on a hidden element. Scope it to the modal and check it is visible and enabled first. Language switch (Glossary — Dutch) The menuitem click ran against an ant-dropdown mid-enter-animation, which is exactly what waitForAntdPopupToSettle exists for. Use it on both switches. Not addressed here, for lack of evidence rather than lack of interest: AdvancedSearchSuggestions, SearchSettings, ContextCenterArticles, ContextCenterMemories, ServiceEntity, GlossaryP2Tests and SSOConfiguration all failed as bare 60s timeouts with no anchor and passed on retry in seconds. Marking them slow would hide a regression just as easily as fix a flake, so they need a trace first. PlatformLineage and DataProductRename are already fixed on main by #31736. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(playwright): bound the wizard Next click instead of waiting the toast out Review point: waiting for the AutoPilot toast to detach is a no-op when the toast has not rendered yet, so a toast that appears a moment later still intercepts the click. Correct, and waiting for it to appear first is not the answer either — the toast is fired by the create call several steps earlier and auto-closes after 5s (showSuccessToast(..., 5000) in AddServicePage), so by the time this line runs it may equally have already closed. Any gate on its presence is wrong for one of the two orderings. Bound the click instead. Playwright retries an intercepted click for the whole action timeout, and 30s outlasts the toast in every ordering: not yet rendered, on screen now, or already gone. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Himanshu Khairajani <[email protected]> Co-authored-by: Anujkumar Yadav <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…elpers (open-metadata#31853) * test(ui): shorten welcome-banner wait in removeLandingBanner The Playwright removeLandingBanner helper waited up to 5000ms for the welcome-screen close button. For storageState sessions the banner never renders (auth.setup records the user in the `loggedInUsers` localStorage key that gates it), so that call always ran out the full timeout — 5s of dead wait per invocation across many specs. Only specs that log in a freshly created user on a new context actually show the banner, and it paints shortly after currentUser resolves, so a bounded wait is still needed. Reduce the timeout from 5000ms to 2000ms, which comfortably covers the fresh-login case while cutting the wasted wait everywhere else. No test asserts on the banner. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test(ui): suppress welcome banner at source, drop removeLandingBanner Follow-up to the timeout reduction: eliminate the welcome-banner dismiss dance entirely instead of waiting on it. The landing page renders the welcome banner only when the logged-in user's `name` is absent from the `loggedInUsers` localStorage key (MyDataPage.component.tsx). storageState sessions already have it seeded (auth.setup logs each user in, which records them), which is why the old removeLandingBanner waitFor always ran out its full timeout — it waited on an element that never appears. Only specs that log in a freshly created UserClass on a new context actually rendered the banner. Seed `loggedInUsers` in UserClass.login() via addInitScript, before the first navigation (mirroring disableEtagConditionalReads). The seeded name equals the app's currentUser.name — responseData.name for a created user, the email local-part for a pure login such as admin — so the banner never renders for any session. With the banner suppressed at the source, the reactive dismissals are dead code and are removed: - delete removeLandingBanner (common.ts) and all ~27 call sites - delete closeWelcomeScreenIfVisible and its inline blocks (searchRBAC.ts) - delete the inline dismiss block in entity.ts Tour.spec.ts keeps its own conditional guards: that suite drives the welcome/tour flow directly and the guards are harmless no-ops now. No test asserts on the welcome banner. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test(ui): let login opt out of welcome-banner suppression for Tour The welcome-banner suppression seeds `loggedInUsers` in UserClass.login, which hid the banner for every session. But the "Tour should work from welcome screen" test enters the tour by clicking the banner's own CTA ("Take a product tour to get started!", rendered only in WelcomeScreen.component.tsx), so suppressing the banner broke it. Add a `suppressWelcomeScreen` login option (default true, so every other spec keeps the suppression) and forward it through AdminClass. Tour.spec logs in with `suppressWelcomeScreen: false` so the banner renders; its other tests keep their existing "dismiss if visible" guards. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * test(playwright): fix five AUT nightly flakes at their cause (open-metadata#31894) * fix(tests): profile in setUpClass so test_list_entity_profiles has data (open-metadata#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. open-metadata#31556 stopped that leak (issue open-metadata#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. * fix(ui): make whole Domain and Data Product rows clickable (open-metadata#31876) * fix(ui): make whole Domain and Data Product rows clickable * addressed comments * Added unit test for the fix * test(playwright): fix five AUT nightly flakes at their cause Collate's AUT nightly run 32476747983 retried 25 tests on each database lane. Fourteen of the distinct specs live here. These five have a cause the artifacts explain; the rest are listed below rather than guessed at. Lineage node clicks (LineageInteraction, both lanes) clickLineageNode clicked the node the moment the caller's getLineage wait returned. React Flow mounts nodes in its own layout pass after that, so the click auto-waited with no timeout of its own and the spec died as a bare "Test timeout of 60000ms exceeded" naming nothing. Assert the node is visible first. Ingestion wizard Next (ServiceIngestion) Creating the service triggers AutoPilot, whose toast renders bottom-center — over the wizard footer. The trace shows the click on next-button intercepted by the toast's own alert-message span, then auto-waiting until the test timed out. Wait for that toast to dismiss before advancing. Knowledge Center owner chip (ExplorePageRightPanel_KnowledgeCenter, both lanes) The Explore summary panel renders owners from the search document, refreshed asynchronously after the owner PATCH. A panel that rendered before the refresh will never show the chip, so the 60s wait was waiting on the wrong thing. Re-open the entity until it is there. Glossary hierarchy modal (GlossaryHierarchy) getByLabel('Select Parent') is page-scoped and also matches the control of a hierarchy modal an earlier step left in the DOM; the click then spent the whole test on a hidden element. Scope it to the modal and check it is visible and enabled first. Language switch (Glossary — Dutch) The menuitem click ran against an ant-dropdown mid-enter-animation, which is exactly what waitForAntdPopupToSettle exists for. Use it on both switches. Not addressed here, for lack of evidence rather than lack of interest: AdvancedSearchSuggestions, SearchSettings, ContextCenterArticles, ContextCenterMemories, ServiceEntity, GlossaryP2Tests and SSOConfiguration all failed as bare 60s timeouts with no anchor and passed on retry in seconds. Marking them slow would hide a regression just as easily as fix a flake, so they need a trace first. PlatformLineage and DataProductRename are already fixed on main by open-metadata#31736. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(playwright): bound the wizard Next click instead of waiting the toast out Review point: waiting for the AutoPilot toast to detach is a no-op when the toast has not rendered yet, so a toast that appears a moment later still intercepts the click. Correct, and waiting for it to appear first is not the answer either — the toast is fired by the create call several steps earlier and auto-closes after 5s (showSuccessToast(..., 5000) in AddServicePage), so by the time this line runs it may equally have already closed. Any gate on its presence is wrong for one of the two orderings. Bound the click instead. Playwright retries an intercepted click for the whole action timeout, and 30s outlasts the toast in every ordering: not yet rendered, on screen now, or already gone. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Himanshu Khairajani <[email protected]> Co-authored-by: Anujkumar Yadav <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]> * test(playwright): assert the hierarchy dialog, not Ant's modal root (open-metadata#31904) changeTermHierarchyFromModal waited on [data-testid="change-parent-hierarchy-modal"] itself. ChangeParentHierarchy passes that testid to Ant's <Modal>, which spreads it onto .ant-modal-root — a position: fixed, zero-size container whose children carry the layout. Playwright requires a non-empty bounding box, so that element is never visible, open or closed, and the assertion could only ever fail: 19 x locator resolved to <div class="ant-modal-root" data-testid="change-parent-hierarchy-modal">...</div> - unexpected value "hidden" while the trace screenshot shows the dialog plainly open. The code this replaced asserted [role="dialog"], which does have a box. Keep the scoping — the bare 'Select Parent' label also matches the control of a hierarchy modal an earlier step left in the DOM — but hang it off the dialog inside the root. Deterministic failure across 5 call sites: GlossaryHierarchy x3, Glossary x2. Co-authored-by: Claude Opus 5 (1M context) <[email protected]> * test(playwright): poll the landing-page widget reveal instead of revealing once waitForLandingPageWidget revealed the widget once and then handed off to expect(widget).toBeVisible(). A deferred slot only mounts its widget when it is scrolled into view, and toBeVisible cannot scroll — so whenever the layout attached after that single reveal, revealLandingPageWidget found nothing to scroll, the widget never mounted, and the assertion spent its full 15s on an element that was never going to appear. Seen in AUT run 32513179631: DomainDataProductsWidgets 'Assign Widgets' saved the layout, got the success toast, navigated to /my-data, and the trace then shows only two zero-count queries and no scroll step before the timeout. The persona docStore document fetched by that same page load contained both KnowledgePanel.Domains and KnowledgePanel.DataProducts with a 200, so the layout was saved and served correctly — only the reveal raced. Poll isLandingPageWidgetVisible, which re-reveals on every iteration and is already used this way elsewhere in this file. A widget that is genuinely absent still fails, at the poll timeout rather than instantly. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Co-authored-by: Harsh Vador <[email protected]> Co-authored-by: Himanshu Khairajani <[email protected]> Co-authored-by: Anujkumar Yadav <[email protected]> Co-authored-by: Shailesh Parmar <[email protected]>
…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 "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.
…ta (#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(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]>
* fix(ci): restore the python pipeline on 1.13 PRs targeting 1.13 are validated by main's workflow definitions: the `pull_request_target` event resolves workflows from the default branch, while `actions/checkout` puts the 1.13 tree on disk. main's `py-tests-shared.yml` therefore runs against a checkout that is missing files it depends on, and every python job goes red regardless of the diff -- #32154, a Java-only backport, failed identically to #32166. Three gaps are fixable from this branch: * `.github/scripts/` does not exist on 1.13 at all. `classify_test_outcome.py` exits 2 *after* the tests pass (a postgres shard logged `101 passed` and `nox > Session integration-tests was successful`, then failed the job), and `configure_docker_storage.sh` exits 127, killing shards 2 and 3 before they download anything. Both scripts are copied verbatim from main; they are stdlib-only Python and plain bash with no new dependencies. The globs they read resolve here -- noxfile.py writes junit/test-results-unit.xml and junit/test-results-integration.xml. * `basedpyright~=1.39.0` floats onto 1.39.10 (released 2026-08-13), which reports ~428 errors against this branch's baseline. main pinned `==1.39.3` in #27834 to stop exactly this; only the pin is taken here, since the rest of that commit conflicts across seven files. * tests/unit/source/pipeline/openlineage/ is not a package, so its test_connection.py collides with the one under tests/unit/metadata/ingestion/connections/ and pytest intermittently reports `import file mismatch`. main disambiguates with __init__.py. Only the leaf marker is added -- enough to make the module name unique without renaming every module under tests/unit/source/. The spaCy 3.8 model mismatch and the ruff-only checkstyle install cannot be fixed from here; both need main's workflows to probe the checkout. Co-Authored-By: Claude Opus 5 <[email protected]> * test(integration): make the airflow, alationsink and ometa tests self-sufficient Backport of the test half of #32145 (2.0, c1e9302). PRs based on 1.13 are validated by main's py-tests-shared.yml, which brings the stack up with `-i false` — no openmetadata_ingestion container, so no Airflow on :8080 and no sample-data DAGs. These three suites still depended on both and failed deterministically: four alationsink cases on shard-2, three test_airflow_lineage cases plus test_es_search_from_name on shard-3, across every Python version. - airflow: a conftest that builds and runs Airflow in a testcontainer joined to ometa_network, so the suite owns its DAGs and connection. apache-airflow 3.3.0 matches this branch's setup.py, the same pin 2.0 uses. - alationsink: build the service, database, schema and tables under test instead of reading sample_data.ecommerce_db. - ometa: a test_team_data fixture creating the "Data" team that test_es_search_from_name asserts on. .dockerignore keeps the airflow image's build context to src/, and only applies to builds whose context is ingestion/ — every other image builds from the repository root with the top-level ignore file. The upstream commit's ingestion/src changes are deliberately omitted: its PLC0415 annotations and dbt/dbtcloud/vertica suppressions target 2.0's ruff and 2.0's basedpyright baseline, neither of which applies here. Its test_ometa_user_api reformatting is also dropped — only the fixture is taken, so the file stays black-conformant on this branch. Does not address shard-2's datalake failures (a 400 on recursive service delete when Airflow is absent), shard-3's trino NO_NODES_AVAILABLE errors, or test_s3_ingestion. Co-Authored-By: Claude Opus 5 <[email protected]> * test(integration): fix the trino readiness race and a stale s3 assertion trino (shard-3, 38 errors): the container readiness probe queried system.runtime.nodes, which the system connector answers on every active node before any catalog can be scheduled. The fixture proceeded and the first ANALYZE failed with NO_NODES_AVAILABLE, erroring every test in the package. Probe a real catalog instead, and replace the flat sleep(1) between write and ANALYZE with a read-back that retries while the hive split is still lagging. Pin the hive-metastore image by digest so :latest cannot drift under a maintenance branch. Only the readiness half of main's trino rework is taken. Its move of drop_stats into a reset_trino_table_statistics fixture, the folding of test_no_statistics into test_profiler, and the removal of test_empty_table_with_dropped_stats_falls_back are a coverage redesign rather than a CI fix, so this branch keeps its global drop_stats call and all three tests unchanged. Nothing in the trino connector source is touched. s3 (shard-3, 1 failed): the container payload no longer inlines children, so `assert 7 == len(bucket.children.root)` raised AttributeError. The next line already asserts the same count through list_container_children. The "Invalid STS API version" logged nearby is the non-mandatory GetMetrics step of the S3 test connection and fails nothing. Co-Authored-By: Claude Opus 5 <[email protected]> * fix(tests): profile in setUpClass so test_list_entity_profiles has data (#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 "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. * fix(ci): stabilize remaining 1.13 Python checks * fix(ci): align 1.13 Python tests with CI --------- Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: IceS2 <[email protected]> Co-authored-by: Himanshu Khairajani <[email protected]> Co-authored-by: Pablo Takara <[email protected]>



Fixes the
py-tests/py-tests-postgresshard-2 failure that is currently blocking the merge queue for every PR that touches ingestion.Root cause
test_list_entity_profilesruns first in its class — before the two tests that create the profiles it asserts on. pytest ordersunittest.TestCasemethods alphabetically (l<p), and the module-levelTestLoader.sortTestMethodsUsing = Noneintended to force definition order only affects unittest’s own loader; pytest collectsTestCasemethods itself and ignores it.Verified against an unmodified checkout — with that line present, collection still yields:
The CI artifacts agree: the junit XML records
test_list_entity_profilesexecuting first, with the other two passing afterwards.Why it passed until 2026-08-20
The test asserts on a global 24-hour window across every table rather than on data it owns. Hard-deleted tables used to leak their profiler rows into that window, so unrelated tests earlier in the shard left behind enough data to satisfy it.
#31556 fixed that leak (issue #27041). The server log from a failing run shows the new purge doing exactly its job:
26 such purges in a single run. With the leak gone, the window is genuinely empty when the listing test runs, and a test that was always logically broken finally started reporting it. #31556 is correct and should not be reverted.
Why it looked branch-specific
PRs that do not touch ingestion skip the integration matrix entirely and report green. Across ~40 recent
py-tests-postgresruns, every "pass" hadpython / Integration Testsskipped, and every run that actually executed it failed. So the queue looks healthy while rejecting all ingestion PRs — currentlyfix/expat-cve-2026-72522,fix/airflow-3.3.1-cve,taipei,pr-31761andayush-shah/ingestion-source-config-type.The change
setUpClassvia a newrun_profiler_workflows()helper, so profiles are class fixture data and no test depends on another’s ordering. This also removes one redundant profiler run.list_profiled_tables(), which was duplicated across both workflow tests.TestLoader.sortTestMethodsUsinghack rather than leave code that looks like it controls ordering.if profiles_all.entities:into an assertion. That guard swallowed an empty unfiltered listing and hid which of the two calls was empty — the one signal needed to diagnose this.test_profiler_workflow_w_globale_configstill re-profiles itself, since it must run after changing the global metric settings.Verification
ruff checkclean,ruff formatclean./v1/entity/profiles/tablereturned 6 table + 37 column profiles), confirming the API is fine and the defect is purely test ordering.Full integration run is on CI — it needs Docker testcontainers plus a live server.
Greptile Summary
Moves the initial profiler execution into class setup so profile-listing tests have deterministic fixture data regardless of test order.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (2): Last reviewed commit: "Merge branch 'main' into fix/profiler-te..." | Re-trigger Greptile