fix(tests): isolate test schemas across concurrent engine variants in integration tests - #6044
Closed
BenjaminVijayaraj5102004 wants to merge 1 commit into
Closed
fix(tests): isolate test schemas across concurrent engine variants in integration tests#6044BenjaminVijayaraj5102004 wants to merge 1 commit into
BenjaminVijayaraj5102004 wants to merge 1 commit into
Conversation
Author
|
HI maintainer can you check this PR |
Collaborator
|
Closing: this PR was machine-generated — templated description, automated ping, no understanding shown. Read |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description & Context
Fixes schema and database collision between concurrent integration test runs (specifically
test_init_project[athena_hive]andtest_init_project[athena_iceberg]).Root Cause
TestContext.__init__previously generatedself.test_idusingrandom_id(short=True). Becauseself.markwas not included in the ID andrandomwas subject to worker seed duplication in parallel xdist runs (gw0andgw1), both Hive and Iceberg test variants generated the exact same database names (test_schema_<test_id>andsqlmesh__test_schema_<test_id>). This caused one worker to drop/modify schemas while the other was still validating tables.Changes
self.test_idintests/core/engine_adapter/integration/__init__.pyto includeself.markand a unique UUID fragment:f"{self.mark}_{uuid.uuid4().hex[:8]}".self.markensures different table format variants (athena_hivevsathena_iceberg) never share a database name.uuid.uuid4().hex[:8]guarantees worker entropy while keeping overall identifier lengths safely within the 64-character limit for engines with strict length limits (e.g. StarRocks, PostgreSQL).tmp_pathto.as_posix()intests/core/engine_adapter/integration/__init__.pyandconftest.pyto prevent YAML scanner escape errors on Windows paths.:memory:catalog paths on Windows inconftest.py.Testing
uv run ruff check(passed with all checks clean).uv run pytest tests/core/engine_adapter/integration/test_integration.py -k "duckdb and test_init_project" -v(passed).