ATLAS-5338: Add Trino extractor integration and unit test suite#691
Open
ramackri wants to merge 7 commits into
Open
ATLAS-5338: Add Trino extractor integration and unit test suite#691ramackri wants to merge 7 commits into
ramackri wants to merge 7 commits into
Conversation
added 5 commits
July 6, 2026 14:44
Implement live integration tests that run the standalone extractor tarball against Atlas + Trino, plus unit tests for cron validation and concurrent job guards. Adds the trino-extractor-it Maven profile and README. https://issues.apache.org/jira/browse/ATLAS-5338
Live-stack integration tests require Atlas and Trino; opt in with -Ptrino-extractor-it so CI mvn verify does not invoke Failsafe here.
Resolve pom.xml conflict: keep opt-in trino-extractor-it profile comment after syncing with master (includes ATLAS-5336 Kafka upgrade and ATLAS-5337 Trino Jersey client fix).
…port Replace List.of() with Arrays.asList() so test code compiles on JDK 8 (CI docker-build matrix).
RegionServer often lags Master on slow runners; the old healthcheck (start_period 40s, 30s interval) and tail-on-HMaster-only entrypoint caused flaky "atlas-hbase is unhealthy" failures during compose up --wait. - Add shared atlas-hbase-healthcheck.sh (wget/curl) for Master + RS - Wait up to 180s for both endpoints before marking container ready - Keep container alive while Master or RegionServer JVMs are running - Install wget/curl in atlas-base; tune healthcheck (120s start_period) - CI: --wait-timeout 300 and dump logs when compose up fails
Use per-test import request mocks and a synchronous executor so Mockito stubs are not accessed concurrently, fixing the JDK 8 ClassCastException flake in testStartImportConsumer_Successful. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Implements the Trino extractor test suite that was previously only sketched as comments in
TrinoExtractorIT. Tests exercise the standalone extractor tarball (run-trino-extractor.sh) against a live Atlas + Trino stack, matching production layout rather than the Maven test classpath.JIRA: https://issues.apache.org/jira/browse/ATLAS-5338
Changes
TrinoExtractorITFull live integration test suite:
-cTRINO_IT_DELETE_SYNC=1)trino_column(opt-in viaTRINO_IT_HOOK_ENABLED=1)TRINO_IT_TAG_PROPAGATION=1)TrinoExtractorITSupportShared test infrastructure:
TrinoExtractorTestUnit tests (no live stack required):
@DisallowConcurrentExecutiononMetadataJobpom.xmltrino-extractor-it: builds extractor tarball inpre-integration-test, runs Failsafe*ITteststestng,commons-iosrc/test/assemblies/trino-extractor-tarball.xmlAssembly descriptor for IT tarball packaging (same
lib/layout as distro).README.mdDocuments how to run unit and integration tests, required environment variables, optional flags, coverage map, and components required to run each test tier.
Components required to run tests
What must be up depends on which tests you run. Full detail is in
addons/trino-extractor/README.md.Unit tests only
mvn -pl addons/trino-extractor test -Dtest=TrinoExtractorTestDefault integration tests (
TrinoExtractorIT)Set
ATLAS_REST_URLand run:Must be running:
trino_*entitieshttp://localhost:21000jdbc:trino://localhost:8080/hivecatalogranger-hivein docker labhivecataloghivehr.trino_pii_lab.ssnMinimum environment variables:
Not required for default ITs: Kafka, Hive hook, Ranger, TagSync, or a pre-built distro tarball (Maven profile builds the IT tarball).
If
ATLAS_REST_URLis unset or Atlas is unreachable,TrinoExtractorITskips (suite passes without live tests).Optional integration tests (extra flags)
TRINO_IT_HOOK_ENABLED=1hive_columnin Atlas (default namespacecm)trino_columnlinks tohive_columnTRINO_IT_TAG_PROPAGATION=1trino_columnTRINO_IT_DELETE_SYNC=1trino_table/trino_schema/trino_catalogremovalTagSync and Ranger are not required even for tag propagation ITs (Atlas REST only).
Test tier matrix
TrinoExtractorTest)hr.trino_pii_lab)* Kafka only if your Hive hook setup uses it; not required by the extractor itself.
** Trino still needed for extractor JDBC; stale entities are seeded via Atlas REST.
Recommended docker lab (default ITs)
Atlas coexist + ranger-docker stack:
atlasranger-trinoranger-hivehivecatalogCreate the test table if missing:
Pre-flight checks:
How to test
Unit tests (no Atlas/Trino required):
mvn -pl addons/trino-extractor test -Dtest=TrinoExtractorTestLive integration tests:
Optional flags:
TRINO_IT_HOOK_ENABLED=1trino_columnlinks tohive_columnTRINO_IT_TAG_PROPAGATION=1TRINO_IT_DELETE_SYNC=1Test plan
mvn -pl addons/trino-extractor test -Dtest=TrinoExtractorTestpassesmvn -pl addons/trino-extractor -Ptrino-extractor-it verifyagainst Atlas + Trino lab (manual; requiresATLAS_REST_URL)Sync with master
origin/master(includes ATLAS-5336 Kafka 3.9.1 / KRaft and ATLAS-5337 Trino Jersey client fix).addons/trino-extractor/pom.xmlconflict (kept opt-intrino-extractor-itprofile).JDK 8 CI fix
TrinoExtractorITSupportusedList.of()(Java 9+), which broketestCompileon the CI JDK 8 matrix job. Replaced withArrays.asList()/Arrays.toString().HBase Docker CI hardening (compose smoke test)
CI Docker image builds were succeeding; failures were in Bring up containers when
atlas-hbasewas marked unhealthy (~27s on slow runners). HBase is only healthy when both endpoints respond:http://localhost:16010/master-statushttp://localhost:16030/rs-statusRegionServer often starts after Master; the old
start_period: 40s,interval: 30shealthcheck andtail --pid=HMasterentrypoint were flaky.Fix (this PR):
scripts/atlas-hbase-healthcheck.shwget/curl)scripts/atlas-hbase.shdocker-compose.atlas-hbase.ymlstart_period: 120s,interval: 10s, use healthcheck scriptDockerfile.atlas-basewget+curlDockerfile.atlas-hbase.github/workflows/ci.yml--wait-timeout 300; dump service logs whencompose up --waitfailsLocal verify (atlas-docker lab):
Note: ports
16010/16030are exposed only when the atlas-dockeratlas-hbasecontainer is running (ATLAS_BACKEND=hbase).A Ranger-only or Postgres-backed Atlas stack does not expose them.
ImportTaskListenerImplTest stabilization (JDK 8 CI flake)
CI run 28991499552 failed on JDK 8 with a deterministic-looking but intermittent unit-test failure (not related to Trino or HBase Docker changes):
ImportTaskListenerImplTest.testStartImportConsumer_SuccessfulClassCastException: ImportStatus cannot be cast to StringatgetImportId()Root cause: the test injected a real
ExecutorServicewhile using a shared Mockito mock forAtlasAsyncImportRequest. The async worker thread accessed mock stubs concurrently with the main thread duringonReceiveImportRequest(), corrupting stub return types.Fix (
030af4da1):createImportRequestMock()helpersynchronousExecutor()helperstartImportConsumeron the calling thread; no concurrent mock access@BeforeMethodMockito.reset()pollreturns id once thennullLocal verify:
mvn -pl webapp -DskipDocs=true -DskipEnunciate=true -DskipITs=true -Drat.skip=true \ -Dtest=ImportTaskListenerImplTest test