Skip to content

test(events): match the Apple processor tests at DISABLED and DEFERRED - #429

Open
abelonogov-ld wants to merge 2 commits into
andrey/retry-after-jitter-and-log-vectorfrom
andrey/event-persistence-mode-test-parity
Open

abelonogov-ld wants to merge 2 commits into
andrey/retry-after-jitter-and-log-vectorfrom
andrey/event-persistence-mode-test-parity

Conversation

@abelonogov-ld

@abelonogov-ld abelonogov-ld commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Test-only; no behavior change and no version bump. Stacked on #426.

Harness. The shared default processor was always built persisting at IMMEDIATE, so DirectEventProcessorWithoutPersistenceTest reran most shared tests with a disk. It now follows persistence().

Ported from the iOS spec (examples with no counterpart here):

  • DEFERRED: a delivery never closes a batch partway through another commit's run.
  • Every mode:
    • going offline and coming back online deliver nothing on their own;
    • the periodic flush posts nothing when there's nothing to send, and only what's new each time;
    • the batch size is recorded for the diagnostic event;
    • a flush bypassing the backoff posts nothing while offline.

The matching iOS tests are on the iOS tier 3 branch. The launch gate at DISABLED is covered on #421.


Note

Overview
Test-only alignment with the Apple event processor suite: no production or SDK behavior changes.

The shared makeEventProcessor factory now derives persistence from persistence() (disk backing and immediate vs deferred) instead of always building an immediate, persisted store—so DirectEventProcessorWithoutPersistenceTest and other subclasses exercise the right mode.

New coverage in DirectEventProcessorTest: offline/online transitions do not send on their own; periodic flush is a no-op when empty and only ships events since the last flush; concurrent commit/delivery never closes a batch mid-commit (DEFERRED-style); diagnostics eventsInLastBatch matches delivered batch size; flushBypassingBackoff() sends nothing while offline.

Reviewed by Cursor Bugbot for commit 07e50b5. Bugbot is set up for automated code reviews on this repo. Configure here.

abelonogov-ld and others added 2 commits November 10, 2026 19:43
The direct-construction helper always built a persisting store committing off
the caller's thread, so the scheduler, close and diagnostic tests ran at
deferred persistence in both classes and never without a disk. It now follows
persistence(): immediate in DirectEventProcessorTest, disabled in its
WithoutPersistence subclass.

Co-authored-by: Cursor <cursoragent@cursor.com>
…d not

Ports the Apple examples with no counterpart here: a delivery never closing a
batch partway through another commit's run (deferred), going offline and back
online delivering nothing on its own, the periodic flush posting nothing with
nothing to send and only what is new each time, the batch size recorded for
the diagnostic event, and a flush bypassing the backoff posting nothing while
offline.

Co-authored-by: Cursor <cursoragent@cursor.com>
@abelonogov-ld
abelonogov-ld requested a review from a team as a code owner November 11, 2026 04:46

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.

1 participant