Skip to content

fix(worker): fail a function whose unit test fails, and name it on downstream skips - #1471

Merged
kvlonge merged 2 commits into
mainfrom
fix/function-test-failure
Nov 14, 2026
Merged

kvlonge merged 2 commits into
mainfrom
fix/function-test-failure

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Why

A function is built before its unit tests run. On a server run, a worker reported it as a success even when one of its tests then failed, and the models calling it were skipped with no cause. The run page showed a green function next to unexplained skips, and "Rerun from failure" left the broken function out.

Changes

  • The worker counts each function's unit tests that the build plans, and holds the function's result until they have all reported.
  • A failing test records the function as failed with the test's error. Downstream skips name the function, and the Failures list and "Rerun from failure" pick it up from the run's node rows.
  • A result still held when the build ends, for example after a fail-fast stop, is published as it was. Test-only and audit-only runs are unchanged.
  • DuckShop edge case: orchestration/worker_failed_function_test.sql.

Verification

  • New worker integration case: a failing UDF test fails udf:udf__order_band, and both models calling it are skipped because of it. It fails on main, where the UDF reports success and the skips have no cause.
  • Control case: a passing UDF test lets the function and its callers build.
  • test_worker.py passes: 42 cases.
  • make check-ci passes.

…wnstream skips

A function is built before its unit tests run, so a worker build reported it
as a success even when a test then failed, and the models calling it were
skipped with no cause. The worker now holds a built function's result until
every test that checks it has reported. A failing test records the function as
failed with the test's error, so the run page, the Failures list and "Rerun
from failure" point at it. Results still held when the build ends are
published as they were.
@kvlonge kvlonge added the full-verify Run the full Verify matrix on this pull request label Nov 14, 2026
@kvlonge
kvlonge enabled auto-merge November 14, 2026 04:21
Both cases failed, so which one the worker recorded against the model
depended on execution order.
@kvlonge
kvlonge added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 4502c30 Nov 14, 2026
76 of 78 checks passed
@kvlonge
kvlonge deleted the fix/function-test-failure branch November 14, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-verify Run the full Verify matrix on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant