Skip to content

Add 'Functions properties fuzzer' job - #102701

Merged
nikitamikhaylov merged 17 commits into
masterfrom
abakharew/move-stress-tests-from-unittests
Apr 23, 2026
Merged

nikitamikhaylov merged 17 commits into
masterfrom
abakharew/move-stress-tests-from-unittests

Conversation

@alexbakharew

@alexbakharew alexbakharew commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Separate unit tests and unit tests with FunctionStress to different jobs.

Version info

  • Merged into: 26.5.1.33

@clickhouse-gh

clickhouse-gh Bot commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8936927]

Summary: ❌

job_name test_name status info comment
Unit tests (msan, function_prop_fuzzer) FAIL IGNORED
Stateless tests (amd_asan_ubsan, distributed plan, parallel, 2/2) ERROR IGNORED
Fast test (arm_darwin) DROPPED IGNORED
Build (amd_release) DROPPED IGNORED
Build (arm_release) DROPPED IGNORED
Build (amd_darwin) DROPPED IGNORED
Build (arm_darwin) DROPPED IGNORED
Build (arm_v80compat) DROPPED IGNORED
Build (amd_freebsd) DROPPED IGNORED
Build (ppc64le) DROPPED IGNORED

AI Review

Summary

This PR splits FunctionsStress from regular unit test execution and adds dedicated sanitizer jobs for it. The direction is good, but there are still correctness/diagnostics regressions in ci/praktika/result.py and a default-duration change in gtest_functions_stress.cpp that can significantly slow non-dedicated runs, so this should not be merged yet.

Findings

⚠️ Majors

  • [ci/praktika/result.py:776] if result.is_error() unconditionally converts infrastructure/runner ERROR states into FAIL, which hides the distinction between test failures and CI/test-runner exceptions. Keep infra failures as ERROR unless there is explicit evidence of a test-process failure (e.g. sanitizer summary or known abnormal termination signature).
  • [ci/praktika/result.py:765] with_log is ignored because Result.from_commands_run is always called with with_log=True. This silently changes API behavior and forces log collection for all callers; pass with_log=with_log (or remove the parameter).
  • [src/Functions/tests/gtest_functions_stress.cpp:152] Default duration_seconds was raised to 600 for all builds. This propagates to non-dedicated invocations and can heavily increase execution time in sanitizer lanes/local runs; keep conservative default in test code and set long duration only in the dedicated CI job configuration.

💡 Nits

  • [ci/praktika/result.py:744] Docstring uses command_prefix, but the actual parameter is command_launcher; update the docstring to match the signature.
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ➖
No test removal ✅
Experimental gate ➖
No magic constants ⚠️ duration_seconds = 600 hard-codes a behavior-sensitive threshold in test code instead of configuring it at job level.
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ⚠️ Current result-status mapping reduces observability by collapsing infra ERROR into FAIL.
Compilation time ✅
No large/binary files ✅
Performance & Safety
  • Conflating infrastructure exceptions with test failures reduces failure triage quality and can mask real CI/runtime issues.
  • The global FunctionsStress default duration increase to 600 seconds materially increases worst-case runtime outside the dedicated fuzzer lane.
Final Verdict

Status: ⚠️ Request changes

Minimum required actions:

  1. Preserve infrastructure ERROR in Result.from_gtest_run; only map to FAIL for proven test-process failures.
  2. Restore with_log parameter semantics (or remove the parameter from API and callers).
  3. Revert broad default duration increase in FunctionsStress; apply long duration via dedicated job config instead.
  4. Fix the command_launcher docstring parameter name.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Apr 14, 2026
Comment thread ci/defs/job_configs.py Resolved
@maxknv
maxknv self-requested a review April 14, 2026 17:39
@nikitamikhaylov

Copy link
Copy Markdown
Member

I guess we can increase the number of the iterations for the Functions fuzzer. Let's target 10 min to run it.

@nikitamikhaylov

nikitamikhaylov commented Apr 15, 2026 •

Copy link
Copy Markdown
Member

Please also make the output more human-readable. It better to show this:

[2026-04-15 09:18:21] unexpected_error: isInjective is false with arguments but true without; executing: SELECT concatAssumeInjective(a, CAST(4.536799294986051e-12 AS Variant(Float64, String))) FROM system.one ARRAY JOIN CAST([-66312.856,-31941864744.05949,0.00053,-0.30027,-274943645.4061,72360.66926,-287127515440.70739,-57575112.74308,0.00041,107395308.39952,-1355124804.8611,-3902706025.71378,0.00009,2018.94878,99014240.35555,0.20894,19570963798.30794,-0.00004,-58659.9978,2054.09971,-3.97436,-79418677.37774,413108.7771,-2081763553.63369,-4481477.88827,493751.64156,-10997199024874.43016,1143.80934,-118.57173,-6007125.59615,-0.00172,-9.10375] AS Array(Decimal(18, 5))) AS a;
[2026-04-15 09:18:21] 
[2026-04-15 09:25:11] unexpected_error: isInjective is false with arguments but true without; executing: SELECT partitionId(CAST('cV1' AS Enum8('cV0' = 12, 'cV3' = 60, 'cV1' = 107, 'cV2' = 116)), b, CAST(109 AS UInt32), CAST('8.38.63.169' AS IPv4), CAST(NULL AS Nullable(Nothing)), f, CAST('1970-01-06 18:58:59' AS DateTime)) FROM system.one ARRAY JOIN CAST(['1bc2:4b17:c6da:b57b:bc3d:acd2:5b75:46de','c4b6:ce37:bc43:98ad:1bd4:d03b:ec1a:ca4e','991:143e:9dc0:fd5:c330:c043:8718:3c8a','8bf4:2d9e:ade6:f690:8dea:7680:ed01:a2e3','1c93:4c67:778e:bb82:b8be:b342:954a:f1b1','c880:5afe:3557:cf5c:1aa8:bb2e:b5a5:3304','ed12:3805:479e:7c18:91ae:606d:8f23:bf4','2dae:bb43:560c:b50a:f147:a4b5:7481:99ac','ca0b:f8bb:e8d1:186:c860:7b94:2eb9:1422','c955:75d8:d124:ff18:baec:890:3cf6:56a7','b258:6fff:327e:7e11:b77c:add9:9c05:a5c9','4221:8a37:ac58:94f5:c31a:5cee:8969:be83','1bd3:acb5:9545:927b:18f8:e07a:c9a0:9ca5','b65b:3090:b076:963c:63b:ce45:638a:a875','72cb:2d67:39dc:6d12:642d:33f3:5454:2c6d','5e6d:2e6d:6b45:96a4:198a:1d5f:767d:8ce0','759:23a1:c6cf:25fd:aaa4:754a:db59:9c06','28df:6c79:abf5:6244:6d5e:9019:b004:f4a5','a3bd:115b:6dc7:44be:3993:32cb:581c:b27b','a916:6f9:8fbc:1dc8:2d56:1f73:2d86:9bfa','3681:324d:ead5:15fa:b9c7:638d:c3f9:c9f6','6a97:69ce:c7d0:68e6:e80f:9959:ef77:5997','c47e:d15a:4974:439b:8a70:bcc3:1df3:ead9','4de3:3306:5a81:9455:1fd4:4319:f1df:c799','1d83:7f0d:495c:7904:ac22:36e3:7465:ee07','a1b5:ff30:4d84:6547:ce73:85c7:c50d:8d20','9d2:70ef:d9f7:3d3e:8f83:2a71:bc47:26','2509:19ff:46a9:6a98:8489:ede1:74be:f783','96af:f992:7344:7512:66ea:acac:c559:74de','df1e:602d:5d39:46f5:64:a654:fb0:a19e','2880:9886:8d9b:6de4:96ff:77b8:dc85:4f0b','b5e6:207d:2b8d:4b3:d3a3:4d55:1edc:e7e4'] AS Array(Variant(FixedString(39), IPv6))) AS b, CAST(['186.180.90.199','255.255.255.243','0.0.0.2','0.0.0.1','255.255.185.223','0.1.183.224','0.35.9.39','255.255.254.113','5.4.226.187','0.0.0.7','255.255.255.254','255.255.255.210','255.255.251.48','210.103.74.149','255.246.181.53','0.112.253.214','255.255.255.246','255.255.255.251','0.0.0.0','0.2.0.102','0.0.0.11','0.0.1.193','255.255.255.254','50.110.230.3','0.0.0.112','0.0.0.107','0.0.251.179','254.75.46.159','0.147.13.72','2.234.141.61','0.0.165.131','255.255.255.238'] AS Array(IPv4)) AS f;

instead of this

[2026-04-15 09:26:20] Failure [Functions properties fuzzer (tsan)]
[2026-04-15 09:26:20]   | fail: 1, passed: 0
[2026-04-15 09:26:20]   Failure [FunctionsStress.stress]
[2026-04-15 09:26:20]     | src/Functions/tests/gtest_functions_stress.cpp:2198
[2026-04-15 09:26:20]     | Value of: ok
[2026-04-15 09:26:20]     |   Actual: false
[2026-04-15 09:26:20]     | Expected: true
[2026-04-15 09:26:20]     | Functions stress test found problems (see log above)
[2026-04-15 09:26:20]   Failure [AllTests]

in this context
image

@nikitamikhaylov

Copy link
Copy Markdown
Member

Actually sometimes we do have a good output
image

Comment thread ci/praktika/result.py Outdated
result.set_info("gtest binary run has non-zero exit code - see logs")
result.set_status(Result.Status.ERROR)
result.set_status(Result.Status.FAILED)
if binary_failed and result.is_error():

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.

⚠️ This condition is too broad and can misclassify infrastructure exceptions as test failures.

binary_failed and result.is_error() also matches cases like missing unit_tests_path / failed chmod / malformed JSON, where ResultTranslator.from_gtest returns ERROR for runner/infrastructure reasons. Converting all such errors to FAILED hides infra exceptions and reduces debuggability.

Could we keep ERROR by default and only downgrade to FAILED for proven test-process exceptions (e.g. binary started but terminated by signal/sanitizer)?

#else
int duration_seconds = 60;
#endif
int duration_seconds = 600;

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.

⚠️ The PR now hard-codes FunctionsStress default duration to 600 seconds for all builds, while the previous sanitizer-aware defaults (10 for sanitizer builds, 60 otherwise) were explicitly tuned to avoid CI timeout/latency issues.

Because this default is used by both CI and local runs (unless callers override --duration), this can significantly increase execution time and make failures slower to surface in sanitizer lanes.

Could we keep the conservative in-test defaults and pass a longer --duration only in the dedicated fuzzer CI job config when needed?

Comment thread ci/praktika/result.py
f"chmod +x {unit_tests_path}",
command,
],
with_log=True,

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.

from_gtest_run still exposes the with_log parameter, but this call now hard-codes with_log=True, so callers can no longer disable log-file collection.

That silently changes API behavior and forces extra disk I/O for every invocation. Could we either pass the parameter through (with_log=with_log) or remove with_log from the function signature to avoid a misleading API?

Comment thread ci/praktika/result.py
@@ -737,10 +742,16 @@ def from_gtest_run(
If it's a job itself job.name will be taken as name by default
:param with_log: whether to log gtest output into separate file
:param command_prefix: prefix to add to gtest command

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.

from_gtest_run now documents command_prefix, but the actual parameter is command_launcher.

That mismatch makes the API contract misleading for callers and maintainers (especially when debugging launcher behavior).

Could you update the docstring field name to command_launcher to match the function signature?

@clickhouse-gh

clickhouse-gh Bot commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.00% 83.70% -0.30%
Functions 91.10% 91.10% +0.00%
Branches 76.50% 76.20% -0.30%

Changed lines: 0.00% (0/29) | lost baseline coverage: 754 line(s) · Uncovered code

Full report · Diff report

@nikitamikhaylov
nikitamikhaylov added this pull request to the merge queue Apr 23, 2026
Merged via the queue into master with commit 508d889 Apr 23, 2026
164 of 166 checks passed
@nikitamikhaylov
nikitamikhaylov deleted the abakharew/move-stress-tests-from-unittests branch April 23, 2026 08:39
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants