[UT] sqltest case optimization #76167
Merged
Merged
Conversation
…r changes Port the applicable subset of the branch-4.1 fixes (bd2a0b8): only the categories whose causing behavior-change PRs are present on branch-4.0. - regexp_extract_all group-0/out-of-range semantics (backport StarRocks#75798, on 4.0 as StarRocks#75880): update test_regex expected results. - SQLTester strict empty-result validation (backport StarRocks#71982, on 4.0 as StarRocks#71995): add the approx_top_k empty-input row and the udtfstring("") two-empty-rows result. - CTAS preserves declared varchar length (backport StarRocks#73498, on 4.0 as StarRocks#74821): test_hive_comment now expects varchar(20). - Deployment-mode output tolerance (safe in both modes): regex-tolerate the COMMENT/PROPERTIES section in test_expr_str2date show-create and the optional warehouse property in test_show_create_routine_load (regex rebuilt on 4.0's recorded output: backticked WHERE column, pause_on_fatal_parse_error property), and normalize CLOUD_NATIVE* object types in test_object_dependencies. - Escape single quotes in _wait_for_query_detail so query details containing userIdentity ('root'@'%') can be embedded in parse_json('...') SQL literals. - Remove test_spill_sort_cancel: it needs the spill_submit_error fail point from StarRocks#74587, which is not on branch-4.0. Not ported because the causing PRs are absent on branch-4.0: struct backtick error messages (StarRocks#68967), REFRESH_TYPE ASYNC (StarRocks#74342), refresh_mode=auto rejection (StarRocks#72313), storage-volume access check (StarRocks#70053), flat-json counter rename (StarRocks#68780), variant parquet lazy materialization (StarRocks#75003). test_mv_iceberg_replace_partition_field does not exist on 4.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The branch-4.0 test tree contains cases synced from main whose driving features/formatting never landed on 4.0. Adapt them to 4.0 behavior: - ORDER BY ALL is not in the 4.0 grammar: rewrite to ORDER BY 1 in test_cte_in_where_subquery and to ORDER BY 1..8 in test_skew_join_with_pre_topn (order feeds LIMIT 3 there). - Key-type/distribution error message on 4.0 is "... must use hash distribution" (CreateTableAnalyzer), not main's "... cannot use random distribution": update test_random_distribution. - SHOW CREATE on 4.0 prints the routine-load WHERE column without backticks and iceberg partition clause without parentheses: make backticks optional in the test_show_create_routine_load regex (self-tested against both variants) and expect "PARTITION BY `k3`" in test_iceberg_view. - 4.0 explain-costs prints scan predicates as "pk IS NOT NULL", not main's typed "[.. INT, true] IS NOT NULL": update test_window_skew_rewrite_with_null. - 4.0 parser error tokens differ: update the expected token list in test_skew_join_v2. - ANALYZE TABLE returns a status row (with a uuid db name): mark the two statements [UC] in test_join_predicate_reuse_feedback. - decimal256 overflow rows are filtered under strict insert on 4.0 too (nightly evidence: "Insert has filtered data"): port the 4.1 insert_max_filter_ratio=1 pin to test_read_write_decimal256. - Remove cases whose prerequisites are main-only: test_iceberg_equality_delete_null_key (CALL procedure, StarRocks#61856), test_non_partitioned/partitioned_mv_with_dropped_partitions (Iceberg DELETE), and the STRUCT_CAST_BY_NAME section of test_jvm_struct_udf (StarRocks#69845) while keeping the position-based coverage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Shared-data-run failures, all test-side or missing-backport issues: - test_load_brpc_reached_timeout / test_load_ha: tag @Native. Main makes the brpc-timeout case work in shared-data via StarRocks#67019, which adds the tablets_channel_add_chunk_wait_write_block trigger to lake_tablets_channel.cpp; branch-4.0 lacks that BE change, so the lake write path never blocks and the load succeeds (error_msg NULL). test_load_ha got @Native in the same main commit. Drop the test_load_brpc_reached_timeout tag if StarRocks#67019 is backported. - test_flat_json_predicate: sync T/R from main (StarRocks#68780). The profile views now filter zero counters ("not like '- %: 0'"), tolerating that shared-data profiles have no GinFilterRows line (no GIN on lake tables). - test_table_sample: tag @Native per main (StarRocks#67319); by_block sampling does not apply to lake tables and falls back to a full scan (655350 rows instead of the 6144-row sample). - test_timetravel: sync T/R from main's unstable-UT hardening (StarRocks#64386/StarRocks#65675/StarRocks#65993/StarRocks#68728): disable iceberg metadata cache (the stale cached branch snapshot returned 1,2,55 after the insert overwrite wrote 111), retry_execute_sql on HMS-flaky writes, explicit db location plus ossutil cleanup. Only the fractional-percent additions of main's test_table_sample were NOT ported (that percent parsing fix is main-only). test_spill_sort_cancel (failpoint chunk_sorter_spill_on_set_finishing missing on 4.0 BE) was already removed in the previous commit; the shared-data failure has the same root cause. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two deep-dive verdicts from the 2026-07-09 nightly, both stale-case issues rather than product bugs: - test_mv_refresh_list_partitions_with_nullable: align with main's StarRocks#62014 rewrite (delete with_nullable, add with_nullable1, sync with_nullable2). The case predates the rewrite (branch-4.0 forked 6 days before it) and its non-null-safe retention condition ("dt > '2024-01-01'") was recorded against the old string-compare behavior for NULL partition values; after backport StarRocks#66353 (StarRocks#65923) NULL partitions evaluate as not-retained and are filtered during refresh, deterministically dropping the NULL rows the R file expects. - test_random_distribution/test_async_mv: port main's StarRocks#72130 rewrite. The old R section refreshed the ASYNC MV without sync mode and immediately selected from it, racing the async task run (empty-table failure); T and R had also drifted apart. The new section asserts show-create properties and queries the base table only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Supersedes the @Native tag from the previous commit: retire the case entirely instead of keeping it shared-nothing-only. It depends on the lake_tablets_channel failpoint trigger from StarRocks#67019 (40f214e), which is not on branch-4.0. Restore the case (T/R identical to main) if StarRocks#67019 is backported. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…4821 The CTAS-varchar backport (StarRocks#73498 -> StarRocks#74821) carried the R file of test_files_schema_insert (no T counterpart), which exercises the FILES() "schema" parameter from StarRocks#72033 — a feature not on branch-4.0 (TableFunctionTable has no PROPERTY_SCHEMA). Restore from main if StarRocks#72033 is ever backported. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
|
@Mergifyio backport branch-4.0.13 |
Contributor
✅ Backports have been createdDetails
|
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.
Why I'm doing:
branch-4.0 nightly SQL-tester runs (2026-07-08/09, both shared-nothing and shared-data) failed on a batch of cases. None of the failures are product regressions on this branch; they fall into three categories: (a) behavior-change backports that landed without their test updates, (b) cases synced from main that depend on main-only features/failpoints, and (c) stale or broken case text that main has since rewritten.
What I'm doing:
1. Adapt expectations to behavior-change backports already on branch-4.0 (
b6b3fde,453650c)test_regex: regexp_extract_all group-0/out-of-range semantics ([BugFix] Fix regexp_extract_all infinite loop on zero-length capture group (backport #75798) #75880, backport of [BugFix] Fix regexp_extract_all infinite loop on zero-length capture group #75798).test_approx_top_k, UDTF empty-string case: strict empty-result validation ([BugFix] SQLTester strict empty result validation for SQL statements (backport #71982) #71995, backport of [BugFix] SQLTester strict empty result validation for SQL statements #71982) exposed never-validated empty expectations.test_hive_comment: CTAS now preserves declared varchar length ([BugFix] Preserve declared VARCHAR length in CTAS (backport #73498) #74821, backport of [BugFix] Preserve declared VARCHAR length in CTAS #73498).test_read_write_decimal256: pininsert_max_filter_ratio=1(overflow rows filtered under strict insert).test_mv_refresh_list_partitions_with_nullable(b4096b1): after [Enhancement] enhance filterPartitionsByTTL so that it properly handles cases where the partition value is null (backport #65923) #66353 (backport of [Enhancement] enhance filterPartitionsByTTL so that it properly handles cases where the partition value is null #65923) NULL partition values evaluate as not-retained under a non-null-safepartition_retention_condition, so the pre-rewrite case deterministically loses its NULL rows; replaced with main'swith_nullable1/with_nullable2split ([UT] Fix some unstable sql tests #62014, which landed on main 6 days after the 4.0 fork).2. Adapt cases that carry main-only content (
453650c,e782150)test_cte_in_where_subquery,test_skew_join_with_pre_topn.test_random_distribution("must use hash distribution"),test_show_create_routine_load(optional backticks),test_iceberg_view(unparenthesized PARTITION BY),test_window_skew_rewrite_with_null(untyped explain-costs predicates),test_skew_join_v2(parser tokens),test_join_predicate_reuse_feedback([UC] for ANALYZE status rows).test_expr_str2date,test_show_create_routine_load(regex over COMMENT/PROPERTIES),test_object_dependencies(normalize CLOUD_NATIVE* object types),@nativetags fortest_table_sample(by_block sampling falls back to full scan on lake tables, per main [UT] Fix some unstable tests #67319) andtest_load_ha(per main [UT] Let test_load_ha/test_load_brpc_reached_timeout work in shared-data #67019).test_flat_json_predicate(filter zero counters, tolerates missing GinFilterRows in shared-data, [UT] Fix unstable SQL Test cases #68780),test_timetravel(disable iceberg metadata cache + retry flaky HMS writes, [UT] FIx unstable UT #64386/[UT] Fix unstable UT #65675/[UT] Fix unstable UT #65993/[UT] Fix unstable UT #68728),test_random_distribution/test_async_mv(remove refresh/select race, [UT] Fix the test case: test_random_distribution #72130).3. Remove cases whose prerequisites are not on branch-4.0 (
b6b3fde,453650c,db57a5f,9534397)test_spill_sort_cancel: needsspill_submit_error([Enhancement] Add the spill-event scheduler base infrastructure #74587) andchunk_sorter_spill_on_set_finishing([BugFix] Fix spill partition sort sink cancel crash #75140 main-side) failpoints; the 4.0 backport [BugFix] Fix spill partition sort sink cancel crash (backport #75140) #75208 carried the test but not the failpoint definitions.test_load_brpc_reached_timeout: needs thelake_tablets_channelfailpoint trigger from [UT] Let test_load_ha/test_load_brpc_reached_timeout work in shared-data #67019 to work in shared-data; restore from main if [UT] Let test_load_ha/test_load_brpc_reached_timeout work in shared-data #67019 is backported.test_files_schema_insert: R-only file carried by [BugFix] Preserve declared VARCHAR length in CTAS (backport #73498) #74821; exercises the FILES() "schema" parameter ([Feature] Add "schema" parameter to FILES() for explicit read schema #72033), absent on 4.0.test_iceberg_equality_delete_null_key(CALL procedure, [Feature] Support call procedure statement #61856),test_non_partitioned/partitioned_mv_with_dropped_partitions(Iceberg DELETE), STRUCT_CAST_BY_NAME section oftest_jvm_struct_udf([Enhancement] Introduce STRUCT_CAST_BY_NAME SQL mode for name-based struct field matching #69845).Also fixes
sr_sql_lib.py_wait_for_query_detailto escape single quotes so query details containing'root'@'%'can be embedded inparse_json()literals.Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check:
🤖 Generated with Claude Code