Skip to content

test: stop scheduler tests depending on runner speed - #1330

Merged
kvlonge merged 4 commits into
mainfrom
test/windows-scheduler-timing
Nov 6, 2026
Merged

kvlonge merged 4 commits into
mainfrom
test/windows-scheduler-timing

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Why

On the Windows runner, orchestration tests failed intermittently with Fenced or a webhook deadline. The cause was not the code under test. Setup that is not about lease expiry held a real 30-second scheduler lease, and a fixed 10-second deadline covered 107 HTTP deliveries with durable receipts. A slow runner exceeded both.

Changes

  • A test helper beside expire_lease, extend_lease_through_test, keeps the elected lease live for the test. The monitor, claims, sensor-bounds and group-admission tests use it instead of renewing per setup chunk. Lease-expiry and failover tests keep the real TTL.
  • wait_for_webhook fails if the running dispatcher delivers nothing for 60 seconds, or after 10 minutes in total, each with its own message. It still requires every event to be delivered and the dispatcher to be running. The old deadline never asserted draining, since the 5-second poll fits inside it.
  • No production code changes. No assertion is removed or loosened, and nothing is skipped or retried.
  • DuckShop: no edge case added; this changes only test timing, with no project shape, data value or lifecycle sequence.

Verification

  • The five affected test modules pass on SQLite and PostgreSQL.
  • Injected stalls (31 s in setup, 120 ms per webhook delivery): the previous tests fail with the same errors as the Windows CI (renew during setup: Fenced, admit independent parents: Fenced, dispatcher drains more than one bounded page: Elapsed), and these pass. The injections were then removed.
  • Clippy, fensu, make check-ci. Independent review: pass; its naming should-fix is applied.

Four orchestration tests held a real 30-second scheduler lease across
setup that is not about lease expiry, so a slow runner fenced them before
the code under test ran. They now hold the lease for the whole test
through a helper beside expire_lease, replacing per-chunk renewals.

The platform webhook test waited a fixed ten seconds for 107 deliveries.
It now fails only when the running dispatcher makes no progress for a
minute; the delivered count and dispatcher assertions are unchanged.

Validated locally on Linux with SQLite and PostgreSQL: the five affected
test modules pass, and with injected stalls (31 s in setup, 120 ms per
webhook delivery) the previous tests fail with the CI errors while these
pass.
Validated locally: the five affected test modules on SQLite and PostgreSQL,
clippy and fensu.
A dispatcher that keeps delivering but trickles now fails with its own
message instead of reaching the job timeout. The one-minute progress bound
is unchanged.

Validated locally: the webhook test on SQLite and PostgreSQL, clippy and
fensu.
@kvlonge
kvlonge enabled auto-merge (squash) November 6, 2026 16:22
@kvlonge
kvlonge merged commit b858c24 into main Nov 6, 2026
91 of 94 checks passed
@kvlonge
kvlonge deleted the test/windows-scheduler-timing branch November 6, 2026 17:45
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