ColtenOuO commented on code in PR #66222:
URL: https://github.com/apache/airflow/pull/66222#discussion_r3254308956
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_pools.py:
##########
@@ -1133,6 +1134,43 @@ def test_update_mask_preserves_other_fields(self,
test_client, session):
assert updated_pool.description is None # unchanged
assert updated_pool.include_deferred is True # unchanged
+ def test_bulk_delete_query_count_is_independent_of_pool_count(self,
test_client, session):
+ # Regression guard for the N+1 fix in
BulkPoolService.handle_bulk_delete:
+ # the query count for a bulk delete must be the same regardless of how
+ # many pools are deleted. A regression that re-queries each pool inside
+ # the loop would add one SELECT per pool, so the larger run would issue
+ # strictly more queries than the smaller one.
+ counts: dict[int, int] = {}
+ for num_pools in (5, 10):
Review Comment:
Done! — refactored to `@pytest.mark.parametrize` with three (count_a,
count_b) cases.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]