Fix flaky Iceberg snapshot trigger tests under CI thread-pool latency - #71825
Merged
Conversation
test_emits_once_per_new_snapshot and test_persists_the_watermark_on_each_event collect 2 events, each requiring several real asyncio.to_thread calls (head lookup plus asset-state-store get/set). The default 1s collection budget in _collect() is tight enough that CI's thread-pool scheduling latency occasionally causes the tests to time out before both events arrive, failing the assertion on an incomplete payload list.
eladkal
approved these changes
Aug 20, 2026
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.
Why
Two tests for the newly added
IcebergTableSnapshotTrigger(#71387) collect 2 events via_collect(trigger, 2), whose default 1s wall-clock budget is too tight given the realasyncio.to_threadscheduling each polling round performs (head-snapshot lookup, plus asset-state-store get/set). Under CI's constrained/parallel runners, thread-pool scheduling latency occasionally pushes the total past 1s, so the collector times out before both eventsarrive and the assertion fails on an incomplete payload list.
Observed failing on unrelated PRs:
test_persists_the_watermark_on_each_event)test_emits_once_per_new_snapshot)What
Widens the collection timeout to 3s for just these two tests. The trigger
implementation itself is correct — a single sequential loop with no
concurrency, so the emitted order is deterministic; this is purely a test
budget issue.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Sonnet 5) following the guidelines