Repository navigation
test: Analytics-engine IT compatibility — seeding adapters and capability gates - #5779
Conversation
…ts for the analytics-engine route Three mechanical adaptations so the integration suite can run against an analytics-engine (parquet, append-only) cluster without mass init failures: 1. TestUtils.stripCustomIds: strip custom _id from bulk index/create action metadata on the analytics-engine route (append-only indices reject custom ids with HTTP 400). Byte-identical no-op on the standard route. 2. TestUtils.seedDocRequest: seeding helper that issues the conventional idempotent PUT /<index>/_doc/<id> on the standard route and POST auto-id on the analytics-engine route. Converted 39 inline seed PUTs across 13 test classes. Tests with real doc-mutation semantics (overwriting a shared fixture id) are gated with DOC_MUTATION instead (testAscii). 3. Gate tests depending on the four multi-valued datasets (otel_logs, deep_nested, nested_type, array) that the parquet store rejects at bulk load: conditional init() loads plus method-level @RequiresCapability(MULTI_VALUE_FIELD_LOAD) where only a few tests depend on the dataset (ExplainIT, CalciteExplainIT, CalciteEvalCommandIT, CalciteExpandCommandIT, IncludeMetadataIT), class-level gates where the dataset is the class's subject (SearchCommandIT, ObjectFieldOperateIT). RequiresCapability is now @inherited so class-level gates apply to subclasses (CalciteSearchCommandIT, CalciteObjectFieldOperateIT); this also closes a latent gap where CalciteCsvFormatIT missed its parent's gate. Signed-off-by: menwe <[email protected]>
…tics-engine route
Second wave of the analytics-engine compatibility campaign, covering the
custom-id seeding paths the first wave's TestUtils conversion missed
(different call shapes: raw new Request("PUT", ...) construction and
programmatic URL building):
1. Convert 24 inline seed PUTs to TestUtils.seedDocRequest across 10 classes
(WireFormat, CaseFunction, ConditionBuiltin, Join, SpathCollision,
EnhancedCoalesce, Exists/In/ScalarSubquery, DataType).
2. Add seed-once guards where init() seeds shared fixtures unguarded
(EnhancedCoalesceIT, ExistsSubqueryIT, CalcitePPLExplainIT): init() runs
as @before, and POST auto-id seeding on the append-only route would
accumulate one duplicate set per test method.
3. CalcitePPLDateTimeBuiltinFunctionIT.initRelativeDocs: keep the per-method
refresh on the standard route (values are wall-clock relative) but seed
exactly once per JVM on the analytics route.
4. Gate CalcitePPLParseIT.testParseOverriding2 with DOC_MUTATION (re-seeds a
shared _id with different content, genuine overwrite semantics).
5. Gate ForeachFieldJsonIT at class level with MULTI_VALUE_FIELD_LOAD: its
only fixture doc carries a multi-value array on a scalar-mapped long
field, which the parquet store rejects at ingest.
Signed-off-by: menwe <[email protected]>
…e analytics-engine route The fixed-_id PUT is rejected by the append-only analytics store, and an unconditional POST re-seed would duplicate the row across the two pushdown mode executions on the shared cluster. Signed-off-by: menwe <[email protected]>
…atibility-report triage Adds 22 capabilities documenting distinct analytics-engine route gaps (datetime builtin scalars, highlight, array scalar functions, foreach, strict-rejection negative tests, checked overflow, error-report context, patterns BRAIN mode, span-window aggregates, fractional span bucketing, comparison delegation, dotted-path docs, constant_keyword, plan recursion depth, search-filter syntax, profile shape, NOT-filter null semantics, rare tie order, spath collision semantics, join max=N, trendline sort, direct-Lucene query paths) and applies class/method gates across 50 test files, mapped one-to-one from the run E failure inventory with two-run (B+E) consistency confirmation per class. Also fixes two test defects rather than gating them: - CalcitePPLMapPathIT: inline bulk seeds routed through the new public TestUtils.adaptBulkBody so custom _ids are stripped on the analytics route (previously the rejected bulk left an empty catalog-invisible index and every test failed with 'Table not found'). - AnalyticsEngineProfileIT: static seed-once flag replaced with an index existence probe; OpenSearchRestTestCase wipes indices between tests so every test after the first queried a deleted index. Signed-off-by: menwe <[email protected]>
…skipped class @afterclass reset() divides by the timing map size; when every test in the class is skipped (capability-gated on the analytics route) the map is empty and the summary throws ArithmeticException, failing the suite despite all tests being correctly skipped. Signed-off-by: menwe <[email protected]>
…ed by clean run Run F (first fault-free full pass over the gated tree) exposed failures that run E's ENOSYS window had masked. Each gate maps to a verified engine-route difference: - AnalyticsEngineSecurityIT: requirePluginOrAssume(SECURITY_PLUGIN) -- the class waited 60s per method for a security plugin the plain AE cluster does not have (43 methods = ~43min of timeouts). Same gate as the sibling security classes. - CalciteFlattenCommandIT: class gate via new FLATTEN_COMMAND -- flatten is a doc-deferred command; struct expansion resolves to zero fields (0 passes across both AE runs). - TopCommandIT (4 methods): new V2_ENGINE_FALLBACK -- with the Calcite setting off the default route falls back to v2 (v2-shaped rows); the analytics route always plans through the new engine. - WhereCommandIT.testInWithIncompatibleType: QUERY_ERROR_MESSAGE -- asserts v2 coercion error text; AE returns different wording. - StandaloneIT.testSourceFieldQuery: DIRECT_LUCENE_QUERY -- standalone unified-query engine reads Lucene directly; parquet indices fail with all-shards-failed (DataFormatAwareEngine illegal state). - CalciteBinCommandIT negative no-pushdown test: STRICT_QUERY_REJECTION -- AE accepts the shape the default route rejects. Not gated (mechanism unverified, flagged for review): WafPplDashboardIT testTopRequestURIs/testTotalBlockedRequests and NfwPplDashboardIT testTopLongLivedTCPFlows -- aggregation results diverge with fully loaded fixtures; needs live reproduction before classification. Signed-off-by: menwe <[email protected]>
…d measure-tie selection
Probe-verified via temporary framework-native diagnostics against the
live analytics-engine cluster (probes reverted, not committed):
- KEYWORD_EQUALS_CASE_FOLD (wrong-result defect, flagged for engine
follow-up): keyword-field equality case-folds the field value on the
analytics route. proto = 'TCP' returns 0 while proto = 'tcp' returns
all 95 docs whose stored value is TCP; in('TCP','UDP') and
like(proto,'TCP') match correctly, so = is inconsistent with its
sibling predicates. Gates WafPplDashboardIT.testTotalBlockedRequests
(action = "BLOCK" -> 0 of 21) and NfwPplDashboardIT
.testTopLongLivedTCPFlows (event.proto = 'TCP' and age > 350 -> 0 of
2; the age range alone returns exactly the right 2 docs).
- AGG_MEASURE_TIE_ORDER: WafPplDashboardIT.testTopRequestURIs expects a
specific count-2 URI (/about) at the head-10 boundary where the
fixture has a 4-way count-2 tie; the analytics route picked /files
and /contact in two independent runs while all non-tie rows matched.
Same family as RARE_TIE_ORDER, general sort-on-measure + head form.
All three failures reproduce identically in runs B, F, and an isolated
2-class run -- stable engine-route differences, not fault artifacts.
Signed-off-by: menwe <[email protected]>
…analytics-engine route The two sibling alternate-syntax methods in the same class already carry @RequiresCapability(FULLTEXT_RELEVANCE_FUNC); the combined comparison method runs the identical queries against the date-typed CreationDate field and was simply missed by the earlier gating pass. Signed-off-by: menwe <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (62.86%) is below the target coverage (99.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #5779 +/- ##
=========================================
Coverage 62.86% 62.86%
Complexity 8814 8814
=========================================
Files 938 938
Lines 40205 40205
Branches 4528 4528
=========================================
Hits 25275 25275
Misses 14125 14125
Partials 805 805
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dai-chen
left a comment
There was a problem hiding this comment.
Is it expected the coverage dropped from 99% to 62.86% as reported by CI?
@dai-chen No, coverage did not drop. The 99% value is the project target configured in |
Description
This change makes the full
integTestRemotesuite pass cleanly against an analytics-engine (parquet-backed) cluster, closing the gap documented in the Analytics Engine PPL IT Compatibility Report. It is test-only: all changes live underinteg-test/src/test/— no product, engine, or build files are touched.The affected tests are predominantly PPL integration tests (the
calciteandpplsuites), plus the shared test harness (TestUtils, the capability gate machinery) and a small number of SQL-surface, security, and analytics lifecycle tests that hit the same analytics-engine route gaps (append-only ingestion, multi-valued parquet fields) regardless of query language.Before this change, an AE-route run produced ~1,500 failures. After it, the suite is all green:
What changed
The failures fell into two fundamentally different categories, and this PR treats them differently:
1. Test-harness incompatibilities — fixed in the test fixtures and seeding utilities.
The AE parquet store is append-only and rejects writes with a custom document id. Many tests seeded fixtures via per-document
PUT /<index>/_doc/<id>, which fails outright on the AE route and left indices empty or partially loaded, cascading into hundreds of downstream assertion failures. This PR introduces route-aware seeding helpers in the test utilities (TestUtils.seedDocRequest,TestUtils.adaptBulkBody) that preserve the exact historicalPUT-with-id behavior on the standard route and switch to auto-idPOSTon the AE route, plus seed-once/seed-if-absent guards where re-seeding would otherwise accumulate duplicates, and test-lifecycle fixes where a static seed-once flag conflicted with the framework's between-test index wipes.2. Known engine-route gaps — skipped via named capability gates.
For functionality the analytics engine does not yet support (deferred commands such as
explain,flatten,mvexpand,streamstats; datetime builtin scalars; multi-valued field ingestion; nested dot-notation field access; and similar), affected tests are annotated with@RequiresCapability(...). Each gate references a named, javadoc-documentedCapabilityenum constant describing the specific gap, so the skip inventory is a reviewable, greppable record of AE's current feature surface rather than a blanket exclusion list. 22 new capabilities were added for gaps that previously had no name.Every gate maps to a documented gap (compatibility-report deferred command, stripped-field query, or an engine-route behavior difference verified by targeted reproduction). Nothing was gated as "unknown cause."
Why gates instead of fixes for category 2
These gaps require engine-side work (some were previously addressed by engine commits on a feature branch that is not portable to this tree). Gating records them as named capabilities so tests automatically re-activate per capability as engine support lands, and the standard route continues to run every gated test — the gates evaluate the active backend at runtime and are inert on non-AE clusters.
Validation
integTestRemote—BUILD SUCCESSFUL, 7,126 tests / 0 failures / 2,265 skipped (XML-verified across 389 JUnit result files). Failure count progression across the campaign: 1,504 → 1,193 → 14 → 1 → 0.Scope
81 files changed, +861 / −114, 100% under
integ-test/src/test/.Related
Capabilityenum constant (GRAPH_LOOKUP_COMMAND, used here to gate twoNewAddedCommandsITmethods). The definition is carried in both so neither PR blocks the other; whichever lands second rebases trivially.