ci(tap): enable ClickHouse tests on TAP suite#101
Merged
Conversation
Copilot stopped reviewing on behalf of
JoshDreamland due to an error
June 1, 2026 15:09
theory
approved these changes
Jun 1, 2026
Comment on lines
+126
to
+128
| target_link_options(pg_stat_ch PRIVATE | ||
| -bundle_loader ${PG_BINDIR}/postgres | ||
| -Wl,-undefined,dynamic_lookup) |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit eaa9073. Configure here.
1 task
serprex
approved these changes
Jun 1, 2026
d76e454 to
4902ec6
Compare
2 tasks
…TAP suite The TAP harness probes localhost:18123 and connects on localhost:19000 — the host ports defined in docker/docker-compose.test.yml. CI was launching ClickHouse with `docker run --network host` on the default 8123/9000, so every ClickHouse-dependent test (010, 011, 018, 021, 023, 027, 031, single-cycle 016) hit `plan skip_all => 'ClickHouse container not running'` and prove reported "All tests successful" with the integration coverage silently disabled. Switching the start/cleanup steps to `docker compose ... up/down` against the existing docker-compose.test.yml gets the ports, container name, and healthcheck the suite already expects, and aligns CI with local dev. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ch to libSystem On macOS, our extension was linked with -undefined dynamic_lookup only, which lets dyld resolve any undefined symbol against whichever loaded dylib exports the name. libSystem.B.tbd exports _hash_search, _hash_create, and _hash_destroy (its POSIX hsearch family) - and dyld was binding our calls to those instead of PostgreSQL's own dynahash. The signatures don't match at all, so PschPostParseAnalyze -> PschRememberNormalizedQuery -> hash_search corrupted libSystem's hash table internals and SIGTRAP'd inside libsystem_malloc on the next allocation. Every macOS-built copy of this extension had the bug; CI is Linux and glibc doesn't export hash_search, so it never surfaced there. PGXS's own Makefile.port handles this by passing -bundle_loader $(bindir)/postgres on Darwin, which resolves undefined symbols against the actual postgres binary rather than libSystem. -bundle_loader is only valid with -bundle, which CMake produces with add_library(... MODULE) rather than SHARED. We also keep -undefined dynamic_lookup so transitive dylib deps (gRPC inside opentelemetry-cpp, etc.) can stay runtime-resolved as before. Verified locally: t/010, t/011, t/021, t/027, t/031 - all previously silently-skipped ClickHouse-dependent TAP tests - now pass against PG 18.3 + ClickHouse 26.1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ght fix Per Copilot review: -Wl,-undefined,dynamic_lookup switches the binary back to flat-namespace runtime lookup, which is exactly the mechanism that let libSystem's hash_search bind ahead of PostgreSQL's. -bundle_loader already establishes two-level namespace resolution against the postgres executable; dynamic_lookup undoes that. PGXS's own Makefile.port doesn't combine the two, and any symbol genuinely missing from postgres should fail at link time rather than silently bind to an unrelated dylib at runtime. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PostgreSQL::Test::Cluster's _logfile is ${log_path}/<name>.log where
log_path = $ENV{TESTLOGDIR} // 'log' (relative to prove's CWD, i.e.
the project root). Last run uploaded tmp_check/ but the pgdata
subdirs there don't contain the bgworker WARNING messages we need
to diagnose the export failures.
4902ec6 to
42c972d
Compare
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.

TL;DR
Some TAP tests apparently never ran on CI before. Now they do.
Drop
--name clickhouse-test; usepsch-clickhousefrom compose fileSummary
docker run --network hoston default ports 8123 / 9000, but every TAP test probeslocalhost:18123and connects onlocalhost:19000— the host-mapped ports fromdocker/docker-compose.test.yml.plan skip_all => 'ClickHouse container not running'whenlocalhost:18123is unreachable) therefore failed in CI, andprovehappily reported "All tests successful" with the integration coverage silently disabled.docker compose -f docker/docker-compose.test.yml up/downso CI gets the same port mapping, container name (psch-clickhouse), and healthcheck the suite already expects, and aligns CI with local dev.Tests that were silently skipped on CI before this
From the most recent green TAP job on
main/ PR 92:010_clickhouse_export,011_clickhouse_reconnect,018_producer_consumer,021_cmd_type_counts,023_drain_loop,024_otel_export(separate — OTel collector is its own gap),025_otel_reconnect,027_query_normalization,031_normalize_cache, single-cycle path in016_boundary_conditions.Note
Medium Risk
CI behavior change exposes previously skipped integration tests; macOS link semantics affect runtime symbol binding for the extension.
Overview
CI TAP now starts ClickHouse with
docker compose -f docker/docker-compose.test.yml(host ports 18123 / 19000, containerpsch-clickhouse) instead of a host-networkdocker runon 8123, so the suite’s readiness checks anddocker execmatch what the Perl tests already use. Failure artifacts uploadtmp_check/andlog/; cleanup uses composedown -v.Build treats
pg_stat_chas a PostgreSQL module (add_library(... MODULE)), and on macOS links with-bundle_loaderto thepostgresbinary frompg_configinstead of-undefined dynamic_lookup, so PG symbols resolve against the server executable and avoid clashes with system libraries.Reviewed by Cursor Bugbot for commit 42c972d. Bugbot is set up for automated code reviews on this repo. Configure here.