Skip to content

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

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

abelonogov-ld wants to merge 7 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: shared DirectEventProcessorTest harness now builds processors via persistence() so non-persisting subclasses (e.g. DirectEventProcessorWithoutPersistenceTest) no longer inherit an always-on disk store.

New coverage mirrors iOS tier-3 expectations: redundant offline/online toggles do not trigger extra sends; periodic flush is idle when empty and ships only events since the last tick; batch close does not interleave with an in-flight commit; diagnostics report eventsInLastBatch (including zero on empty flush); and flushBypassingBackoff() sends nothing while offline.

Reviewed by Cursor Bugbot for commit dea600f. 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
@cursor cursor Bot added the risk:low label Nov 21, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: Low.

Automated risk review (dry run): Low

This PR would be automatically approved.

Why: The change is test-only in DirectEventProcessorTest.java: the shared processor factory now follows persistence(), and new tests cover DISABLED/DEFERRED behavior already covered on Apple. Cursor Bugbot passed with no findings.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dry-Run PR Approver

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: low. Not approved under SDK rule 2 (approve only PRs opened by an SDK team member). Cursor Bugbot completed with no findings; human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: low. Not approved under SDK rule 2 (approve only PRs opened by an SDK team member). Cursor Bugbot completed with no findings; human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: low. Not approved under SDK rule 2 (approve only PRs opened by an SDK team member). Cursor Bugbot completed with no findings; human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: low. Not approved under SDK rule 2 (approve only PRs opened by an SDK team member). Cursor Bugbot completed with no findings; human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: low. Not approved under SDK rule 2 (approve only PRs opened by an SDK team member). Cursor Bugbot completed with no findings; human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant