Skip to content

Commit c3aa7ec

Browse files
rustyconoverclaude
andcommitted
fix(ci): boot the http integration worker from the staging dir
copy_from/copy_to tests have DuckDB write a source file under a relative __TEST_DIR__ that the worker then opens by the same relative path; the worker only resolves it if it shares DuckDB's cwd. The stdio lane inherits DuckDB's cwd for free, but the http worker was started from the repo root, so those tests failed in the http lane. Boot it with `( cd "$STAGE" && exec ... )` so it shares the unittest binary's cwd (mirrors the vgi repo's run_http_integration.sh); exec keeps the worker on the captured pid for teardown. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8ff6341 commit c3aa7ec

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

ci/run-integration.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,23 @@ trap cleanup EXIT
133133
# set BOOTED_PORT to the port it reports (PORT:<n>, the worker's readiness
134134
# contract). Sets a global rather than echoing so the backgrounded worker stays a
135135
# child of this shell (a $(...) subshell would reparent it and break teardown).
136+
#
137+
# The worker is spawned with cwd=$STAGE — the same directory the unittest binary
138+
# runs from below (`cd "$STAGE"`). copy_from/copy_to tests have DuckDB write a
139+
# source file under a relative `__TEST_DIR__` (duckdb_unittest_tempdir/...) that
140+
# the worker then opens by the same relative path; the worker only resolves it
141+
# if it shares DuckDB's cwd. On the stdio lane the C++ extension spawns the
142+
# worker as a subprocess that inherits DuckDB's cwd, so it matches for free; the
143+
# `( cd … ; exec … )` subshell gives the http worker the same footing (and
144+
# mirrors the vgi repo's run_http_integration.sh, which boots server and DuckDB
145+
# from one cwd). exec keeps the worker on the subshell's pid so teardown via the
146+
# captured `$!` still works.
136147
BOOTED_PORT=""
137148
boot_http_worker() {
138149
local exe="$1" log pid port=""
139150
BOOTED_PORT=""
140151
log="$(mktemp)"
141-
"$exe" --http --port 0 >"$log" 2>&1 &
152+
( cd "$STAGE" && exec "$exe" --http --port 0 ) >"$log" 2>&1 &
142153
pid=$!
143154
echo "$pid" >> "$BG_PIDS_FILE"
144155
for _ in $(seq 1 60); do

0 commit comments

Comments
 (0)