Skip to content

Make match_max effective in 05098_client_psql_describe_table - #118379

Merged
PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:make-match-max-effective-05098
Sep 6, 2026
Merged

PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:make-match-max-effective-05098

Conversation

@groeneai

@groeneai groeneai commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

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):

Make match_max take effect in 05098_client_psql_describe_table, so the expect harness holds a whole \l listing instead of running with expect's 2000-byte default buffer.

Description

Stateless tests (arm_binary, parallel) failed this one-day-old test (#118281) with Reason: return code: 1, its expect_after timeout arm, on #117423: report.

match_max 100000 on line 23 runs before the spawn on line 41, and without -d it applies to the current spawn id, of which there is none yet, so the client ran with expect's 2000-byte default: a 6001-char buffer. The bare \l expands to SHOW DATABASES, which on that shared runner listed 69 databases, each padded to 219 chars by a concurrent test's ~200-char name, a 15,754-char burst, 2.6x the window. The .expect.debuglog shows expect forgetting output four times while matching the prompt after that \l, ending with the buffer pinned at 6001, a 13-char final read, and the timeout.

match_max -d 100000 makes the value the test already asks for reach the spawn.

Verified locally: [match_max] after a spawn reports 2000 without -d and 100000 with it. Against a 17,679-char listing, the debuglogs of 50 runs hold 304 full-buffer discards without the change and 0 with it; reverting only the -d brings them back. 50/50 runs pass either way. The 60 s timeout itself is rate-dependent and did not reproduce locally; what is shown is that the assertion ran in a discard regime the declared buffer would have prevented.

Of the 62 .expect tests here, the other 60 set match_max the same ineffective way. As in #112160 this changes only the test that is failing, since a larger buffer also makes expect retain older output, which could affect negative expect patterns elsewhere. Bounding the listing instead, as #113713 did for 02105_backslash_letter_commands, would drop the bare \l this line asserts and would let expect "system" match the echoed predicate; the listing therefore stays shared-server output, now with room for about 6x the measured burst.

Related: #117423


Workflow [PR]
Sync PR [sync-upstream/pr/118379]

`match_max 100000` on line 23 runs before the `spawn` on line 41, and without
`-d` it applies to the *current* spawn id, of which there is none at that point,
so the client ran with expect's 2000-byte default buffer, i.e. 6001 chars of
capacity.

The bare `\l` expands to `SHOW DATABASES`. On a shared `arm_binary, parallel`
runner that listed 69 databases with every row padded to 219 chars, because a
concurrent test held a ~200-char database name: a 15,754-char burst, 2.6x the
window. The test failed by timeout there, on
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117423&sha=8f6c4316969230ee19799531b03487484cacf0b6&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29
(ClickHouse#117423), where the
`.expect.debuglog` shows expect forgetting output four times while matching the
prompt on line 94, ending with the buffer pinned at 6001 and a final read of 13
chars.

Use `match_max -d 100000` so the value the test already asks for is inherited by
the `spawn`.

Verified locally: `[match_max]` after a `spawn` reports 2000 without `-d` and
100000 with it. With 75 databases and one 206-char name making the listing
17,679 chars, the debuglogs of 50 runs hold 304 full-buffer discards without
this change and 0 with it, and the widest buffer expect examines rises from the
6001-char ceiling to the whole listing; reverting only the `-d` brings the
discards back. 50/50 runs pass with and without that fixture. The 60 s timeout
itself is rate-dependent and did not reproduce locally, so what is shown here is
that the assertion ran inside a discard regime the test's declared buffer would
never have entered.

Of the 62 `.expect` tests under `tests/queries/0_stateless`, the other 60 set
`match_max` the same ineffective way; as in
ClickHouse#112160 this commit only changes
the test that is failing, since a larger buffer also makes expect retain older
output, which could affect negative `expect` patterns in the other tests.

Co-Authored-By: Claude Opus 5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect labels Sep 6, 2026
@groeneai

groeneai commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: 1 finding, adjudicated

⚠️ major, test-liveness - "the test does not prove the client inherited 100000, so reverting -d still passes; assert [match_max] after the spawn." Not done, and it is your call. The factual half is true and is stated in the description: the 60 s timeout is rate-dependent and did not reproduce locally. Against adding the assertion: #112160 makes this exact change in 04615_client_progress_table_toggle_config with a comment and no assertion; no .expect file under tests/queries/0_stateless queries [match_max]; and the check would compare against a literal 18 lines above it, so the only mutation it catches is an edit to that line. Say the word and I will add it.

💡 The burst is produced by a concurrent test, not by this one: the failing debuglog's padding driver is a 211-char database name owned by test_j5f0m6s0n2m7. That is why the job's own 71 reruns of this test passed with the old form.

Session id: cron:clickhouse-review-slot-8:20260906-042800

@clickhouse-gh

clickhouse-gh Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [b27db6c]

Summary: ✅


AI Review

Summary

This PR fixes tests/queries/0_stateless/05098_client_psql_describe_table.expect so the requested match_max value is actually inherited by the spawned client session. I reviewed the current diff, the full test, the prior PR discussion, and the current CI state; I did not find an actionable correctness, test, or metadata issue in the patch as written.

Final Verdict

✅ No actionable findings.

@groeneai

groeneai commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

cc @azat, could you review this? match_max 100000 in this test runs before the spawn and without -d, so the client kept expect's 2000-byte default and a 15,754-char bare \l listing on a shared runner overflowed the window while matching the prompt. #112160 made the same one-token fix in 04615_client_progress_table_toggle_config.

@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Sep 6, 2026
@PedroTadim PedroTadim self-assigned this Sep 6, 2026
@PedroTadim
PedroTadim added this pull request to the merge queue Sep 6, 2026
Merged via the queue into ClickHouse:master with commit 949051a Sep 6, 2026
174 of 175 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 6, 2026
@clickhouse-gh clickhouse-gh Bot added comp-cli clickhouse-client (interactive CLI) and client library. and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-cli clickhouse-client (interactive CLI) and client library. groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect 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.

3 participants