Skip to content

test(mongodb): align the in-process _since test with the inclusive filter (#1840) - #1841

Open
angela-helios wants to merge 1 commit into
mainfrom
fix/1840-mongo-since-inclusive
Open

angela-helios wants to merge 1 commit into
mainfrom
fix/1840-mongo-since-inclusive

Conversation

@angela-helios

Copy link
Copy Markdown
Contributor

Fixes #1840.

main has been red since #1796: Test Rust fails mongodb_integration_sof_since_filter on every push. That covers #1810, #1822 and #1818, plus PRs branched from them, such as #1839. It is deterministic, not a flake.

#1796 (for #1707) made the in-process runner's _since inclusive, >=, to match the SQL runners and the native Mongo runner ($gte). This MongoDB integration test still assumed the old exclusive filter: it took the cutoff from since-obs-before's own stored timestamp and expected that resource to be excluded. With an inclusive filter, a resource updated exactly at the cutoff is kept, so the assertion fails every time.

Change

The behavior stays as #1796 defined it; only the test changes.

  • Exclusion case: the cutoff is now the first write's timestamp plus one millisecond, the precision MongoDB stores. That is the first instant that excludes it, and the write after it, 5 ms later, is still kept.
  • New boundary case: a cutoff equal to the first write's own timestamp keeps both resources. This pins the inclusive semantics in the MongoDB suite as well.

The future-cutoff case is unchanged.

Verification

  • The MongoDB test binary compiles (cargo test -p helios-persistence --features mongodb --test mongodb_tests --no-run).
  • Clippy on helios-persistence, all targets and features, is clean.
  • The suite itself needs Docker, which is not available here, so this PR's Test Rust run is the check.

…lter (#1840)

#1796 made the in-process runner's _since inclusive, matching the SQL
and native Mongo runners, but mongodb_integration_sof_since_filter
still took its cutoff from the first write's own timestamp and expected
that write excluded, so main has failed it on every push since. The
exclusion cutoff is now one millisecond after the first write, and a
new boundary case pins that a write exactly at the cutoff is kept.

This branch has not been deployed

No deployments
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.

test(mongodb): mongodb_integration_sof_since_filter fails on every main push since #1796 made the in-process _since inclusive

1 participant