Repository navigation
Apply soft-timeout to integration tests flaky check - #105819
alexey-milovidov merged 1 commit into
Conversation
The integration tests flaky check runs each modified test ~50 times across all changed test modules. With existing per-phase timeouts of `session_timeout_parallel` = 2h and `session_timeout_sequential` = 1h x N attempts, the total wall-clock time can far exceed the workflow's global job timeout. When the global timeout fires, the pytest subprocess is hard-killed via `Shell.run`'s subprocess timeout, leaving no session-finish record in the pytest jsonl report and producing `Unknown error (exit status: None)` on the report instead of a proper FAIL/OK summary. Reproduced on `Integration tests (amd_asan_ubsan, flaky)` for ClickHouse#105171: job ran 2h18m54s before the global timeout, errored with the above message, and the report shows ERROR / no test results. The functional tests flaky check already handles this via a soft `FLAKY_CHECK_TIME_LIMIT` (see `ci/jobs/functional_tests.py:544-554`): it bounds the time spent inside `clickhouse-test`, so the job has headroom for cleanup, log collection, and reporting before the global timeout fires. This commit ports the same logic to `ci/jobs/integration_test_job.py`: 1. `FLAKY_CHECK_TIME_LIMIT = 90 * 60` (90 min, longer than functional's 45 min because integration tests are slower). 2. Cap both `session_timeout_parallel` and `session_timeout_sequential` to the remaining budget at the start, so a single phase cannot consume the entire budget. 3. In the sequential-attempts loop, recompute the remaining budget every iteration. Break out of the loop early when the budget is exhausted (< 60s left). Cap each iteration's session-timeout to the remaining budget. 4. Treat session-timeout in flaky check as expected (do not propagate as a job-level error and filter out the synthetic `Timeout` result), matching how targeted checks already handle session-timeout. Reference: ClickHouse#105171
|
Pre-PR validation gate (session id:
Chose |
|
Workflow [PR], commit [2edfeef] Summary: ✅ AI ReviewSummaryThis PR adds a soft time budget for integration flaky checks to avoid hard-killed jobs near workflow timeout, and it filters synthetic Findings
Final VerdictStatus:
|
| failed_tests_files.extend(test_result_parallel.files) | ||
| if test_result_parallel.is_error(): | ||
| if not is_targeted_check: | ||
| if not is_targeted_check and not is_flaky_check: |
There was a problem hiding this comment.
This condition now suppresses all Result.Status.ERROR outcomes in flaky mode, not only expected soft session-timeout cases.
If pytest exits with an internal/usage/unknown error (for example exitstatus 3/4/None), test_result_*.results can be empty; combined with the later Timeout filtering, the job can finish OK even though pytest failed.
Please keep has_error = True for non-timeout errors and only ignore explicit session-timeout cases (for example by checking test_result_*.info/the synthetic Timeout marker before suppressing). The same guard at line 976 needs the same treatment.
| if is_flaky_check: | ||
| elapsed_for_flaky = int(sw.duration) | ||
| flaky_check_remaining_s = max(FLAKY_CHECK_TIME_LIMIT - elapsed_for_flaky, 0) | ||
| if flaky_check_remaining_s < 60: |
There was a problem hiding this comment.
We may want to set it greater, to be at least the single test timeout or the single test maximum time, e.g., 180 sec, but better - 300 sec.
The integration tests flaky check runs each modified test ~50 times across every changed test module. With existing per-phase pytest session timeouts (
session_timeout_parallel= 2h,session_timeout_sequential= 1h × N attempts), total wall-clock time can far exceed the workflow's global job timeout. When the global timeout fires, the pytest subprocess is hard-killed byShell.run's subprocess timeout, leaving no session-finish record in the pytest jsonl and producingUnknown error (exit status: None)instead of a proper FAIL/OK summary.Observed on
Integration tests (amd_asan_ubsan, flaky)for PR #105171: ran 2h18m54s, errored withUnknown error (exit status: None), no test results in the report.Job log: https://github.com/ClickHouse/ClickHouse/actions/runs/26416267614/job/77763513026
The functional tests flaky check already handles this via a soft
FLAKY_CHECK_TIME_LIMITinci/jobs/functional_tests.py:544-554. This PR ports the same logic toci/jobs/integration_test_job.py:FLAKY_CHECK_TIME_LIMIT = 90 * 60(90 min; longer than functional's 45 min because integration tests are slower).session_timeout_parallelandsession_timeout_sequentialto the remaining budget at the start so a single phase cannot consume the entire budget.--session-timeoutto remaining.Timeoutresult), matching how targeted checks already handle session-timeout.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
cc @alexey-milovidov (per directive on #105171), @maxknv, @leshikus (comp-ci-infrastructure)
Version info
26.6.1.275