Skip to content

test(session/database): use fixed ids in the tied timestamp order test - #2186

Merged
wolo-lab merged 2 commits into
google:mainfrom
Vivek1106-04:fix/stable-order-test-flake
Nov 7, 2026
Merged

wolo-lab merged 2 commits into
google:mainfrom
Vivek1106-04:fix/stable-order-test-flake

Conversation

@Vivek1106-04

Copy link
Copy Markdown
Contributor

Linked issue

Problem:
TestEventsSharingATimestampComeBackInAStableOrder fails about once in 720 runs, because its random event ids can sort into exact reverse insertion order.

Solution:
Give the six events fixed ascending ids, so the sorted result is always the insertion order and the check only fails when the tiebreak is missing.

Behavior change

Nothing, it's a test change.

Testing Plan

Unit Tests:

  • All unit tests pass locally.

With your source change reverted and your tests kept, which test fails?

No source change here. Removing , id DESC from the query fails this test every time, so it still catches the missing tiebreak. With descending ids it fails with the same error as CI. 200 runs pass with the fix.

Manual End-to-End (E2E) Tests:

N/A

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

@wolo-lab wolo-lab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@wolo-lab
wolo-lab merged commit e9aba9e into google:main Nov 7, 2026
15 checks passed
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.

session/database: TestEventsSharingATimestampComeBackInAStableOrder fails about once in 720 runs

2 participants