Skip to content

Make concurrent integration test assertions order-independent - #100

Merged
lesnik512 merged 1 commit into
mainfrom
fix/order-independent-integration-asserts
Oct 4, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
fix/order-independent-integration-asserts

Conversation

@lesnik512

Copy link
Copy Markdown
Member

test_real_kafka_direct_ack_from_handler_is_refused and test_real_kafka_stop_application_from_inner_middleware_does_not_kill_the_app run with concurrency_limit=5, so messages 1 and 2 are handled concurrently and can finish in either order. Both tests asserted [1, 2] in completion order, and CI run 37190570935 (floors 3.11) failed with assert [2, 1] == [1, 2].

The tests are meant to check which messages got processed, not the order they finished in, so both now compare sorted ids.

I checked the rest of tests/test_integration.py. The remaining multi-message assertions already use sorted() or only check counts, and the single-message ones can't depend on order.

No failing test was written first. The failure is a scheduling race that can't be reproduced on demand. just lint and just test (227 passed) pass locally.

@lesnik512
lesnik512 merged commit 763e9d2 into main Oct 4, 2026
11 checks passed
@lesnik512
lesnik512 deleted the fix/order-independent-integration-asserts branch October 4, 2026 09:34
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.

1 participant