Skip to content

fix(tests): Fix flaky test_snuba_data_transaction timestamp drift#108972

Closed
joshuarli wants to merge 1 commit intomasterfrom
fix/flaky-test-snuba-data-transaction
Closed

fix(tests): Fix flaky test_snuba_data_transaction timestamp drift#108972
joshuarli wants to merge 1 commit intomasterfrom
fix/flaky-test-snuba-data-transaction

Conversation

@joshuarli
Copy link
Copy Markdown
Member

Summary

  • Fix flaky test_snuba_data_transaction by freezing time
  • The test compared nodestore and Snuba timestamps, but before_now() calls at different real-time moments caused off-by-one second differences
  • freeze_time() makes all timestamp computations deterministic

Fixes #108963

Test plan

  • Test passes 10/10 locally

The test compared nodestore and Snuba timestamps, but before_now()
calls happen at different real-time moments, causing off-by-one second
differences. Fix by freezing time to make all timestamp computations
deterministic.

Fixes #108963
joshuarli added a commit that referenced this pull request Feb 23, 2026
- Add @freeze_time() to test_snuba_data_transaction (from #108972)
- Add @freeze_time() to test_datetime_uses_timestamp_ms_from_snuba (from #108974)

Combines fixes from #108972, #108974, #108905.
@joshuarli
Copy link
Copy Markdown
Member Author

Combined into #109096

@joshuarli joshuarli closed this Feb 23, 2026
joshuarli added a commit that referenced this pull request Feb 25, 2026
- Add @freeze_time() to test_snuba_data_transaction (from #108972)
- Add @freeze_time() to test_datetime_uses_timestamp_ms_from_snuba (from #108974)

Combines fixes from #108972, #108974, #108905.
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: tests/sentry/services/eventstore/test_models.py::EventTest::test_snuba_data_transaction

1 participant