Skip to content

Coalescer budget test controls its submission window - #864

Merged
zlareb1 merged 1 commit into
mainfrom
test/coalescer-budget-clock
Nov 18, 2026
Merged

zlareb1 merged 1 commit into
mainfrom
test/coalescer-budget-clock

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Related: #841

Changelog category (leave one):

  • CI Fix or Improvement

Why

The coalescer budget test assumes 200 submissions enter one window but uses real loop time. A legal window expiry adds another pair of point writes and fails its two-write assertion. Control that test's loop clock with the existing manual clock and explicitly flush its intended window.

Scope and risk

Only the failing test changes, using the same clock-and-flush pattern as its existing neighbor. All four assertions, 200 inputs, values and byte budget are identical. The SDK's window duration, batch size, retry behavior and implementation remain unchanged. The test still verifies the request bound, point-write count, entry order and returned versions.

Compatibility, rollout and rollback

  • Wire: no changes.
  • Operator steps: none.
  • Rollback: reverting restores the real-clock test; no stored data changes.

Tests

  • CI on the preceding composition fails this test with four point writes instead of two. The exact hosted expiry instant is unobserved; the source permits that result when submissions cross a window boundary.
  • The corrected test and three existing neighbors pass: single-window batching, ordered unchecked retries, and an entry too large for the first budget slot. Four focused checks pass in 1.96 seconds.
  • AST comparison confirms all four assertions and every other test node are identical. Ruff lint, formatting and git diff --check pass.
  • Reproduce the focused checks with python -m pytest -q and these nodes from tests/unit/test_sdk_set_coalescer.py: test_unchecked_sets_go_out_again_in_batches_the_size_the_budget_checked, test_third_set_inside_the_window_starts_a_bulk, test_an_unchecked_set_and_the_later_sets_of_its_key_go_out_again_in_order, test_an_unchecked_set_too_long_even_first_in_a_request_goes_alone.
  • All 42 current-head checks and all three applicable workflows pass, including all six unit shards, coverage, floors, offline benchmarks and native/Postgres integrations. No broad suite ran locally.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (Codex wrote the diff); the loop clock, explicit flush and unchanged assertions were checked.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • No generated contract changes.
  • No migration changes.
  • No plugin behavior changes.
  • No frontend changes.
  • This description names operator steps and wire changes.
  • Repository text contains no deployment details or private content.
  • Commits are signed off.

Hold the existing single-window premise with the manual loop clock and flush explicitly. Keep the budget, batch limits, inputs and all assertions.

Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit 1099de6 into main Nov 18, 2026
42 checks passed
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