Skip to content

Expect the prefetch reduction to be skipped under per-consumer QoS - #10682

Merged
auvipy merged 1 commit into
celery:mainfrom
GangEunzzang:test/consumer-smoke-per-consumer-qos
Sep 21, 2026
Merged

auvipy merged 1 commit into
celery:mainfrom
GangEunzzang:test/consumer-smoke-per-consumer-qos

Conversation

@GangEunzzang

Copy link
Copy Markdown
Contributor

Since the Kombu 5.7.0a1 bump (#10677), t/smoke/tests/test_consumer.py fails on rabbitmq:latest in six cases: test_reducing_prefetch_count[rabbitmq-1..5] and test_prefetch_count_restored[rabbitmq]. Kombu 5.7 reports per-consumer QoS for RabbitMQ 4 (celery/kombu#2481), and in that mode the worker skips the prefetch-count reduction after a connection restart (#9512), so the "Temporarily reducing…" and "restored to the maximum" log lines the tests wait for never appear.

This makes the expectation conditional on the QoS mode, decided the same way Tasks.qos_global() decides it (not connection.qos_semantics_matches_spec): under per-consumer QoS the tests expect the "Skipping prefetch count reduction after connection restart" log; under global QoS the existing assertions run unchanged.

Verified locally against rabbitmq:latest (4.3.5): the whole module passes with Kombu 5.7.0a1 (10 passed, the 8 pre-existing Redis xfails unchanged), the six cases going through the skip branch, and test_reducing_prefetch_count[rabbitmq-2] and test_prefetch_count_restored[rabbitmq] still pass through the global branch on a tree pinned to Kombu 5.6.2.

Background in #10679; this keeps that PR on the revoke fix only, as requested.

Kombu 5.7 reports per-consumer QoS for RabbitMQ 4, and the worker skips
the prefetch-count reduction after a connection restart in that mode
(celery#9512), so the consumer smoke tests that expect the reduction and the
gradual restore fail against rabbitmq:latest.

Decide the expectation the same way Tasks.qos_global() does and expect
the skip message under per-consumer QoS; the original assertions stay in
place for brokers that still use global QoS.
@auvipy
auvipy self-requested a review September 21, 2026 15:16
@auvipy auvipy added this to the 5.7.0 milestone Sep 21, 2026
@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.28%. Comparing base (1ba6258) to head (e4d2bb8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10682   +/-   ##
=======================================
  Coverage   89.28%   89.28%           
=======================================
  Files         153      153           
  Lines       20391    20391           
  Branches     2430     2430           
=======================================
  Hits        18206    18206           
  Misses       1881     1881           
  Partials      304      304           
Flag Coverage Δ
unittests 89.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@auvipy

auvipy commented Sep 21, 2026

Copy link
Copy Markdown
Member

just curious why the chord related tests are also green here? are the related?

@GangEunzzang

Copy link
Copy Markdown
Contributor Author

@auvipy Not related, this only touches test_consumer.py. The chord failure is a race between the chord error handler's FAILURE write and the revoke broadcast's REVOKED write, so it doesn't show up every run: it hit 1 of the 20 test_canvas jobs on #10677's run, 0 of 20 on main after the merge, and 0 of 20 here, while locally it failed 5 out of 5 runs. #10679 removes the race.

@auvipy

auvipy commented Sep 21, 2026

Copy link
Copy Markdown
Member

OK cool

@auvipy
auvipy merged commit e257838 into celery:main Sep 21, 2026
392 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants