test: stabilize records and streams integration tests - #2816
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the data modeling records integration tests to improve robustness against eventual consistency delays and slow CI environments. Key changes include updating assert_eventually to use a deadline-based timeout, introducing a RecordBatch dataclass to track stable cursors and filters, and adding comprehensive unit tests for these integration helpers. Feedback suggests using getattr with a fallback when retrieving the name of the assertion callable in assert_eventually to prevent potential AttributeError crashes.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2816 +/- ##
==========================================
- Coverage 93.15% 93.09% -0.06%
==========================================
Files 516 516
Lines 53665 53722 +57
==========================================
+ Hits 49993 50014 +21
- Misses 3672 3708 +36
🚀 New features to boost your workflow:
|
Drop the shared helper module and the unit tests that exercised it. The stabilization fixes now live inline in the integration test.
| @dataclass | ||
| class RecordBatch: | ||
| records: list[RecordWrite] | ||
| filter: filters.Equals # Scopes every query to this batch, so parallel runs don't see each other | ||
| cursor: str # Sync position captured before ingestion |
There was a problem hiding this comment.
Lets not create dataclasses purely for testing purposes
Edit: maybe this is fine, but please rename to include "test"
…ds.py Co-authored-by: Håkon V. Treider <haakonvt@gmail.com>
Description
Fix cross-run contamination in the upsert test by scoping queries to each batch. Harden cleanup, stream creation races, consistency polling, and sync pagination with a cursor captured before ingestion.
Checklist: