Skip to content

CI: fix the macOS job and the HTTP Cloud job - #737

Merged
ccoltx merged 2 commits into
mainfrom
polyglot/ci-cloud-replica-pin-macos
Nov 17, 2026
Merged

ccoltx merged 2 commits into
mainfrom
polyglot/ci-cloud-replica-pin-macos

Conversation

@polyglotAI-bot

@polyglotAI-bot polyglotAI-bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Two checks fail on main (3ad7df0f) and on every same-repo PR since 2026-11-13, for example #728. This PR fixes both. The changes are in CI and test code only. The client does not change.

1. macOS / macOS Tests (macos-14): cancelled in 1 s

GitHub refuses the job before a runner starts: The configuration 'macos-14-arm64-us-default' is not supported. GitHub retired all macOS 14 images on 2026-11-02 (actions/runner-images#15226). The job is cancelled on main since 2026-11-09.

Fix: macos-14 → macos-26, the newest GA arm64 image. The matrix still has one arm64 leg and one Intel leg (macos-15-intel).

2. Cloud / Cloud Tests - AWS (HTTP): 22 to 25 failures per run

All failures are in 4 fixtures, in two groups:

  • SessionConnectionTest: CREATE TEMPORARY TABLE, then SELECT from it in the same session → UNKNOWN_TABLE (code 60).
  • JsonModeTests (Memory tables), InsertBinaryCompressionTests and InsertBinaryQueryPlacementTests (MergeTree): insert, then SELECT with the same client → 0 rows (Assert.That(reader.Read(), Is.True)).

The HTTP Cloud job was last green on main at 40f965cb (2026-11-11 06:05Z). No commit after it changes the HTTP client. The TCP Cloud job stays green. The set of failing tests changes from run to run.

Cause: the Cloud proxy now sends each HTTP request to a replica of its own, also on one keep-alive connection (the session tests use one connection). A session and a Memory table exist on one replica only, and a replica can read a MergeTree table before it has the parts that another replica inserted. Replica-aware routing is a per-service HTTP toggle; requests with the same X-ClickHouse-Replica-Tag go to one replica. The clickhouse-java Cloud tests broke the same way in September 2026 when that toggle was switched on for their service. #724 notes that the HTTP client can already send this header with CustomHeaders.

Fix:

  • TestUtilities.GetTestCustomHeaders(): on Cloud it returns X-ClickHouse-Replica-Tag: clickhouse-cs-tests-<guid>, with one value for the whole run. In other environments it returns no headers, so local, cluster and other CI jobs send the same requests as before.
  • GetTestClickHouseClientSettings sets these headers, so GetTestClickHouseClient, GetTestClickHouseConnection and AbstractConnectionTestFixture send them.
  • SessionConnectionTest and JsonModeTests make their own settings, so they set the headers too. SessionConnectionTest.CreateConnection used the connection-string constructor, which cannot carry headers. It now uses new ClickHouseClientSettings(builder), which reads the same builder (UseSession, SessionId, Compression).
  • ClickHouse.Driver/AGENTS.md: one bullet that tells a test that makes its own settings to set these headers.

Verification

  • I cannot reach the Cloud service from outside CI, so the Cloud / Cloud Tests - AWS job of this PR is the end-to-end check.
  • Header on the wire: I pointed the suite at a local listener that logs request headers. With CLICKHOUSE_TEST_ENVIRONMENT=cloud, every request (the CREATE DATABASE set-up, both session requests, the JSON-mode requests) has the same tag. Without it, 6 requests had no tag.
  • CLICKHOUSE_TEST_ENVIRONMENT=cloud, --filter Category=Cloud, net10.0, against a local 26.x server: 791 passed, 5 skipped, 0 failed. The server accepts the header.
  • Full ClickHouse.Driver.Tests, net10.0, local server: 14878 passed, 142 skipped, 0 failed.

No changelog fragment: the client does not change.

Checklist

  • Unit and integration tests covering the common scenarios were added (none needed: the existing Cloud tests are the check)

🤖 Generated with Claude Code


Note

Low Risk
CI matrix and test harness only; no production client API or runtime behavior changes.

Overview
Fixes two failing CI checks without changing the ClickHouse.Driver client.

macOS workflow: Replaces retired macos-14 with macos-26 in the test matrix so the macOS job can start on a supported arm64 runner (Intel leg unchanged).

Cloud HTTP tests: Adds TestUtilities.GetTestCustomHeaders(), which on Cloud sends a stable per-run X-ClickHouse-Replica-Tag so replica-aware routing keeps session, Memory, and insert-then-read traffic on one replica. Default test client settings pick this up; SessionConnectionTest and JsonModeTests that build their own ClickHouseClientSettings set the same headers (session tests no longer use a connection-string-only constructor). AGENTS.md documents that convention for future tests.

Reviewed by Cursor Bugbot for commit 5252b34. Bugbot is set up for automated code reviews on this repo. Configure here.

macOS: GitHub retired the macos-14 runner images on 2026-11-02, so the
macos-14 leg is cancelled before it starts. Use macos-26, the newest GA
arm64 image. The Intel leg (macos-15-intel) stays.

Cloud (HTTP): the Cloud proxy now sends each HTTP request to a replica
of its own, also on one keep-alive connection. Temporary tables of a
session, Memory tables and MergeTree reads right after an insert then
fail. In Cloud mode, every test client now sends one per-run
X-ClickHouse-Replica-Tag header, so all requests of the run reach one
replica. TestUtilities.GetTestClickHouseClientSettings sets it, and the
two fixtures that make their own settings (SessionConnectionTest,
JsonModeTests) set it too. Outside Cloud no header is sent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 15:26

Copilot AI left a comment

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.

🟢 Approval recommended

No active review issues remain for the CI workflow and Cloud HTTP test setup changes.

No open issues 🎉

What changed in this PR

This PR addresses macOS and Cloud CI failures through workflow and HTTP test setup changes. Production client code is unchanged.

Changes:

  • Replace macos-14 with macos-26, retaining the Intel runner.
  • Apply one shared replica-routing tag to Cloud HTTP test clients, including session and JSON-mode clients.
  • Document the header requirement for tests that create their own settings; non-Cloud runs remain unchanged.
File Description
ClickHouse.Driver/​AGENTS.md Document routing headers for custom test settings.
ClickHouse.Driver.Tests/​Utilities/​TestUtilities.cs Generate a shared Cloud replica tag and apply it to default test settings.
ClickHouse.Driver.Tests/​Types/​JsonModeTests.cs Add routing headers to JSON-mode test clients.
ClickHouse.Driver.Tests/​ADO/​SessionConnectionTest.cs Use settings-based connections and add routing headers.
.github/​workflows/​tests-macos.yml Move the arm64 test job to macos-26.

Review effort: Balanced

@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@security-ai-gate-reviewer

security-ai-gate-reviewer Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

AI review gate — auto-approval withheld

The AI review gate is green, but the approver did not approve 5252b34c: it changes paths that always require a human reviewer: .github/workflows/tests-macos.yml (commit 466d0e6 has no verified signature; commit 466d0e6 has no verified signature).

What to do: ask someone with write access who is not the PR author to approve this pull request.

History (latest 5 heads, newest first)

  • 5252b34cee18 withheld — it changes paths that always require a human reviewer: .github/workflows/tests-macos.yml (commit 466d0e6 has no verified signature; commit 466d0e6 has no verified signature)
  • 466d0e677dbe withheld — it changes paths that always require a human reviewer: .github/workflows/tests-macos.yml (commit 466d0e6 has no verified signature; commit 466d0e6 has no verified signature)

@ccoltx
ccoltx requested a review from a team as a code owner November 16, 2026 18:05
@ccoltx
ccoltx merged commit 7d8bfef into main Nov 17, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants