Skip to content

UTS: make history's time-range test detect an ignored range, and fix the RSL2b labels - #588

Open
owenpearson wants to merge 2 commits into
mainfrom
fix/uts-history-time-range
Open

owenpearson wants to merge 2 commits into
mainfrom
fix/uts-history-time-range

Conversation

@owenpearson

Copy link
Copy Markdown
Member

Fixes the two defects reported in #549: rest/integration/history.md's time-range test passes when start and end are ignored, and the three RSL2b sections in both history.md files are filed under the wrong sub-point.

1. The time-range test now fails when the range is ignored

The test builds an early and a late window from server-assigned timestamps, but its four assertions only say what each page contains: each is non-empty, the early page has an early* name and the late page a late* name. An unfiltered page contains both batches, so all four hold for a client (or server) that drops start, end or both. The test was green when the range was ignored.

The assertions now:

  • assert min_late_ts > max_early_ts first. This is the premise the 2 ms wait exists to establish and the boundary arithmetic depends on. If both batches land in one millisecond, the test fails here and not on a window check that could never hold.
  • replace the two ANY checks with ALL: every item in the early window starts with early, and every item in the late window with late. The length >= 1 checks stay, so ALL can't pass on an empty page. The UTS pseudocode has no NONE idiom, so this uses ALL rather than the NONE lines suggested in the issue.

Both window checks are needed, because each mutation fails only one of them:

Client behaviour Old four assertions ALL early in early window ALL late in late window
honours start and end pass pass pass
drops start pass pass fail
drops end pass fail pass
drops both pass fail fail

(Evaluated against the sandbox timestamps measured in #549. The issue's sandbox runs also confirm the server filters both bounds exclusively, so the new assertions pass against a correct client.)

SDKs need to re-derive this test. ably-js (uts-integration branch), ably-dotnet (AIT-1378/uts-integration) and ably-cocoa (main) all carry the original four assertions verbatim, so they pass whether or not their start/end reach the request. ably-python already asserts the premise and the exclusions locally, under a UTS SPEC ERROR comment.

2. The RSL2b sections are filed under the points they test

features.md defines RSL2b1 as start/end, RSL2b2 as direction and RSL2b3 as limit. Both history files had these rotated by one.

  • Integration (rest/integration/history.md): direction forwards moves to RSL2b2, the limit parameter to RSL2b3 and the time range to RSL2b1. The heading, Test ID and "Spec requirement" line change for each.
  • Unit (rest/unit/channel/history.md):
    • "Default direction is backwards" moves to RSL2b2.
    • "Limit parameter" moves to RSL2b3. default-limit-hundred-0 was already correctly under RSL2b3 and keeps its id, so the limit test takes the -1 suffix. The section also moves below default-limit-hundred-0, so the suffix follows file order. Its content is unchanged (git diff --color-moved shows a pure move plus relabels).
    • Channel names in both renamed tests follow the new points, as in UTS: correct wrong/nonexistent spec-point references in rest/unit Test IDs #539.
    • "History with time range" now has the heading RSL2b1. Its Test ID rest/unit/RSL2/history-time-range-1 stays as it is: RSL2 is the parent point, so it's less specific than it could be but not wrong. Without this, no unit test would be filed under RSL2b1.
    • "Default limit is 100" (RSL2b3) and "History query parameters" (RSL2b) were already right and haven't changed.

The Spec points: lines already list RSL2b1–b3 and haven't changed, nor has completion-status.md.

Old → new Test IDs (5)

This follows the policy in #539: a Test ID is renamed only when its spec point names a different requirement, and parent-family ids stay as they are. SDK repos can apply this table mechanically to their UTS: tags.

Old Test ID New Test ID
rest/integration/RSL2b1/history-direction-forwards-0 rest/integration/RSL2b2/history-direction-forwards-0
rest/integration/RSL2b2/history-limit-parameter-0 rest/integration/RSL2b3/history-limit-parameter-0
rest/integration/RSL2b3/history-time-range-0 rest/integration/RSL2b1/history-time-range-0
rest/unit/RSL2b1/default-direction-backwards-0 rest/unit/RSL2b2/default-direction-backwards-0
rest/unit/RSL2b2/limit-parameter-0 rest/unit/RSL2b3/limit-parameter-1

No other Test ID changes.

Interaction with other PRs

#538 also edits rest/unit/channel/history.md, but only the mock-infrastructure path near the top of the file. It touches a different hunk, so the two merge cleanly.

Closes #549

🤖 Generated with Claude Code

owenpearson and others added 2 commits November 27, 2026 13:48
The four assertions in history.md's time-range test only say what each
window contains. The unfiltered page contains both batches, so all four
hold for a client that drops `start`, `end` or both.

Assert that every item in each window carries that window's name prefix,
which an ignored `end` fails in the early window and an ignored `start`
fails in the late window. Also assert `min_late_ts > max_early_ts`, the
premise the 2ms wait exists to establish, so a same-millisecond pair of
batches fails on the premise rather than on the window checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
features.md has RSL2b1 as `start`/`end`, RSL2b2 as `direction` and RSL2b3
as `limit`. Both history.md files had these rotated by one.

Integration tier: direction forwards becomes RSL2b2, the limit parameter
RSL2b3 and the time range RSL2b1, with their Test IDs.

Unit tier: default direction becomes RSL2b2. The limit parameter becomes
RSL2b3, joining default-limit-hundred-0, so it takes the -1 suffix and
moves below that section to keep the suffix in file order; the section
is otherwise unchanged. Channel names follow the new points. The time
range test's heading now names RSL2b1; its Test ID keeps the parent RSL2,
which is less specific but not wrong.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
staging/pull/588 — 0abe617b Deployed Nov 27, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

history.md's time-range test passes when start and end are ignored — and the three RSL2b sections are each filed under the wrong point

1 participant