Skip to content

fix(it): run the UI test MySQL on the shipped collation, and clean up a server that fails to start - #37142

Merged
shrabantipaul-collate merged 3 commits into
mainfrom
fix/it-containerized-server-failed-launch
Nov 6, 2026
Merged

shrabantipaul-collate merged 3 commits into
mainfrom
fix/it-containerized-server-failed-launch

Conversation

@manerow

@manerow manerow commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Issue

No issue. Found together with PR #37141, while finding why the nightly "Java UI ITs (embedded)" jobs on main and 2.1 have lost their runner every night since 10-20.

Problem

When the OpenMetadata server container fails to start, ContainerizedServer.launch throws but leaves the MySQL and OpenSearch containers it started still running. UiTestServer remembers nothing about the failure, so the next UI test class launches a whole new stack, waits about 6 minutes, fails, and leaks that stack too.

In the nightly embedded jobs, each leaked stack holds about 3 GB. After 8 or 9 test classes the 16 GiB runner node runs out of memory and the kernel kills the runner process. GitHub then reports "The self-hosted runner lost communication with the server", with no test results at all. That is what main and 2.1 have shown every night since 10-20. The server fails to start because the test MySQL runs on utf8mb4_unicode_ci, on which the 2.1.0 migration cannot finish.

What this PR changes

  • The containerized UI test MySQL now runs on the collation OpenMetadata ships with (utf8mb4_0900_ai_ci, the MySQL 8 default): ContainerizedServer no longer passes --collation-server=utf8mb4_unicode_ci.
  • ContainerizedServer.launch stops everything it started (server, mock IdP, OpenSearch, MySQL and the network) when any start step fails, then rethrows.
  • UiTestServer.get remembers a failed boot and rethrows it to every later caller. The first test fails with the real cause; the rest fail at once with "The UI test server failed to start earlier in this run", instead of each booting another stack.

How it was tested

The nightly's embedded UI IT step, run locally (OpenSearch):

Server image Before With this PR
One that cannot start (main on a utf8mb4_unicode_ci test MySQL) every class boots a new stack and leaks it; containers pile up until the run is stopped the first class fails after 348 s, the other 9 within milliseconds, the run ends in 7 minutes, at most one stack is alive at a time, and nothing is left running
A working one (on utf8mb4_0900_ai_ci) 10 tests pass 10 tests pass (1 skipped, as before)

Summary by Gitar

  • Test database:
    • Dropped the forced --collation-server=utf8mb4_unicode_ci flag, so containerized MySQL uses the collation OpenMetadata ships with

This will update automatically on new commits.

@manerow manerow added the safe to test Add this label to run secure Github workflows on PRs label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

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.

@manerow manerow changed the title fix(it): stop a containerized UI test server that fails to start, and fail fast after it fix(it): run the UI test MySQL on the shipped collation, and clean up a server that fails to start Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

The Java checkstyle failed.

Please run mvn spotless:apply in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Java code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@gitar-bot

gitar-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Changing UI test boot-failure handling and MySQL collation could make later tests fail fast and expose collation-dependent differences.

Stops the containerized UI test server's already-started MySQL, OpenSearch, and mock IdP containers when a launch step fails, and makes later UI test classes fail fast with the original boot error instead of launching new stacks. 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

@manerow
manerow requested review from a team and yan-3005 and removed request for a team November 5, 2026 11:13
@shrabantipaul-collate
shrabantipaul-collate enabled auto-merge (squash) November 5, 2026 19:23
"--character-set-server=utf8mb4",
"--collation-server=utf8mb4_unicode_ci",
"--max_allowed_packet=64M");
.withCommand("--character-set-server=utf8mb4", "--max_allowed_packet=64M");

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.

With #37141 and #37150 closed, bootstrap/sql/migrations/native/2.1.0/mysql/schemaChanges.sql lines 1095-1098 on main still compare entity_relationship / entity_extension ids with ontology_axiom_entity, which is created with an explicit COLLATE=utf8mb4_0900_ai_ci. So a MySQL whose default collation is utf8mb4_unicode_ci still fails the 2.1.0 migration, and after this change no test runs on that collation anymore.

Is utf8mb4_0900_ai_ci a stated requirement for 2.1 (then it needs an upgrade note or a preflight check), or is a migration fix still coming? Same question applies to #37143.

@manerow manerow Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utf8mb4_0900_ai_ci is already the default we ship in Docker: the Docker script, MySQL 8 and the new tables all use it. PR #37142 aligns the test with that. Our Helm openmetadata-dependencies chart creates utf8mb3 databases instead, through Bitnami's default, and those upgrade to 2.1 now that PR #37189 and PR #37190 are merged. The remaining gap is utf8mb4 with another collation, like utf8mb4_unicode_ci, which can't upgrade to 2.1. I haven't found a real customer in that state, so I'd state the supported collation in the upgrade notes, with a query to check it. We'd only build a conversion if a real one turns up.

@shrabantipaul-collate
shrabantipaul-collate merged commit 74b0529 into main Nov 6, 2026
68 of 70 checks passed
@shrabantipaul-collate
shrabantipaul-collate deleted the fix/it-containerized-server-failed-launch branch November 6, 2026 10:53
manerow added a commit that referenced this pull request Nov 6, 2026
… a server that fails to start (backport 2.1 #37142) (#37143)

* fix(it): stop a containerized UI test server that fails to start, and fail fast after it

* fix(it): run the containerized UI test MySQL on the collation OpenMetadata ships with

* style(it): apply spotless
yan-3005 added a commit that referenced this pull request Nov 23, 2026
…s' (#38443, #37142) (#38442)

* fix(it): run the UI test MySQL on the shipped collation, and clean up a server that fails to start (#37142)

* fix(it): stop a containerized UI test server that fails to start, and fail fast after it

* fix(it): run the containerized UI test MySQL on the collation OpenMetadata ships with

* style(it): apply spotless

(cherry picked from commit 74b0529)

* Select FQN-cleanup probe hashes in one collation on MySQL

The hard-delete cleanup from #38126 probes every taggable entity table in
one UNION ALL. MySQL rejects a UNION whose columns have different
collations, and an install's hash columns do not share one: most are
ascii_bin, the newer tables declare utf8mb4_0900_ai_ci, and
query_entity.fqnHash (renamed in 1.2.0 without a collation) takes the
server default. On a server whose default is not utf8mb4_0900_ai_ci,
every hard delete of a taggable entity fails with
"Illegal mix of collations for operation 'UNION'".

On MySQL each probe now selects CONVERT(hash USING utf8mb4) COLLATE
utf8mb4_bin. The WHERE clause still reads the bare column, so the lookup
keeps its index. No schema change.

(cherry picked from commit 4f9ccf8)

* Run the FQN-cleanup probes on a real MySQL with mixed hash collations

The SQL-string test cannot catch the collation error. This one starts
MySQL with utf8mb4_unicode_ci as the server default and three tables on
the collations an install mixes (ascii_bin, utf8mb4_0900_ai_ci, server
default). The bare-column union fails with 'Illegal mix of collations';
the namesake and nested probes return the hash from every table.

(cherry picked from commit 5316487)

---------

Co-authored-by: Adrià Manero <adria.estivill@getcollate.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 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