Skip to content

Fix two tests - #690

Merged
evertlammerts merged 1 commit into
duckdb:v2.0-cyanopterafrom
evertlammerts:fix-ci-flaky-tests
Oct 17, 2026
Merged

evertlammerts merged 1 commit into
duckdb:v2.0-cyanopterafrom
evertlammerts:fix-ci-flaky-tests

Conversation

@evertlammerts

Copy link
Copy Markdown
Member

Two tests in tests/fast/api/test_execute_contract.py failed or hung CI runs today without a defect in the change under test.

test_two_lazy_polars_frames_of_one_connection_cannot_be_joined expected a refusal when polars collects a join of two lazy frames of one connection. The refusal only happens when polars runs both sources at the same time, and with 5 and 3 row tables one source can finish before the other opens, so the test passed or failed with the runner's timing (two failures in about twenty assertion job runs). It is replaced by two tests: one holds an Arrow reader open by hand and collects a single lazy frame, which must be refused with the open-result message and must collect once the reader is closed; the other keeps the join covered by accepting either the refusal (open result or busy, depending on where the second call lands) or the joined rows, and checks the connection works afterwards.

test_a_copy_that_fails_late_raises_from_execute can hit a pre-existing engine deadlock in the async write queue teardown of a failing COPY (AbortWrites holds the submission lock while DrainTasks waits for a task that needs it). Under xdist the job then sat until the 90 minute workflow timeout. The test now carries a 60 second pytest-timeout bound with the thread method, the only method that can end a hang in engine code with the GIL released. Under xdist the stuck worker is reported as crashed and the suite finishes; in the jobs that run without xdist the run ends after a minute instead of six hours. This is containment; the deadlock itself is an engine bug with a reproducer and stacks on file.

Verified with 20 serial runs of the polars tests, the file under four workers, and a temporary hanging test that the marker ended in 60 seconds.

@evertlammerts
evertlammerts added this pull request to the merge queue Oct 16, 2026
Merged via the queue into duckdb:v2.0-cyanoptera with commit 8076209 Oct 17, 2026
30 checks passed
@evertlammerts
evertlammerts deleted the fix-ci-flaky-tests branch October 17, 2026 02:32
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.

1 participant