Skip to content

Commit 359b18f

Browse files
fix: make concurrent declarative source test order-agnostic
The test_read_concurrent_declarative_source test was failing on Python 3.13 due to race conditions in concurrent processing that caused records to be returned in different orders. This change replaces the strict list equality assertion with a sorted comparison that validates the same records are present without caring about their order. Fixes the flaky test failure: test_no_pagination_with_partition_router-manifest4-pages4-expected_records4-expected_calls4 Co-Authored-By: AJ Steers <[email protected]>
1 parent e5a1fc2 commit 359b18f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

unit_tests/sources/declarative/test_concurrent_declarative_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3885,7 +3885,7 @@ def test_read_concurrent_declarative_source(
38853885
output_data = [
38863886
message.record.data for message in _run_read(manifest, _stream_name) if message.record
38873887
]
3888-
assert output_data == expected_records
3888+
assert sorted(output_data, key=lambda x: (x.get("partition", 0), x.get("ABC", 0), x.get("AED", 0))) == sorted(expected_records, key=lambda x: (x.get("partition", 0), x.get("ABC", 0), x.get("AED", 0)))
38893889
mock_retriever.assert_has_calls(expected_calls)
38903890

38913891

0 commit comments

Comments
 (0)