Skip to content

Ordered set fixtures control their batching window - #871

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

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

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Related: #864

Changelog category (leave one):

  • CI Fix or Improvement

Why

The ordered-set helper promises two point writes followed by one batch, but its real loop clock allows the submissions to cross the coalescer window. A failing run records four point writes and no batch, so it never exercises the intended ordered retry path. Establish the helper's promised window with the existing manual clock and public flush.

Scope and risk

Only _sets_of_one_key changes. Its clock patch lasts for the helper call and is restored on exit. Both callers' inputs, verdicts, refusal object and assertions are identical, as is every other test node. The SDK implementation, window, byte budget, batch limits and retry rules are unchanged. Tests that exercise real expiry do not use this helper.

Compatibility, rollout and rollback

  • Wire: no changes.
  • Operator steps: none.
  • Rollback: reverting restores the uncontrolled test window; no stored data changes.

Tests

  • The existing ordering case fails in CI with zero bulk requests instead of one. The exact hosted submission timestamps are unobserved; source permits the recorded four direct writes when the intended batch crosses a window boundary.
  • Four directly related checks pass in 1.58 seconds: both helper callers, the controlled budget case and the controlled third-set batching case. An earlier capacity refusal started no test and remains recorded as not run.
  • AST comparison confirms every top-level node except this helper is identical. Ruff lint, formatting and git diff --check pass.
  • Reproduce with python -m pytest -q and these nodes from tests/unit/test_sdk_set_coalescer.py: test_an_unchecked_set_and_the_later_sets_of_its_key_go_out_again_in_order, test_an_unchecked_set_is_written_when_the_later_one_of_its_key_is_refused_alone, test_unchecked_sets_go_out_again_in_batches_the_size_the_budget_checked, test_third_set_inside_the_window_starts_a_bulk.
  • No broad suite ran locally. All 42 current-head PR checks and all three workflows pass, including the full unit and integration suites.

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

  • AI-generated (Codex wrote the diff); the helper lifetime, flush and unchanged caller contracts 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.

@zlareb1
zlareb1 merged commit 49dd4a3 into main Nov 18, 2026
42 checks passed
@zlareb1 zlareb1 mentioned this pull request Nov 18, 2026
6 tasks done
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