Commit b339824
authored
fix(tests): prevent tag inheritance tests from polluting production Celery queue (#14493)
product_tags_post_add_remove dispatches propagate_tags_on_product via dojo_dispatch_task.
When the signal fires outside a request context (e.g. during test setUp), get_current_user()
returns None, so we_want_async() always returns True regardless of block_execution — the task
goes to the shared Redis queue. The real Celery worker then picks it up and runs against the
live database, causing multi-hour tag propagation runs over large products.
Fix: add @override_settings(CELERY_TASK_ALWAYS_EAGER=True) to the three test classes that
enable system-wide product tag inheritance. This makes Celery run tasks inline in the test
process, keeping tasks off the shared Redis queue and ensuring assertions see propagated tags.1 parent e039b0b commit b339824
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
| 457 | + | |
457 | 458 | | |
458 | 459 | | |
459 | 460 | | |
| |||
610 | 611 | | |
611 | 612 | | |
612 | 613 | | |
| 614 | + | |
613 | 615 | | |
614 | 616 | | |
615 | 617 | | |
| |||
626 | 628 | | |
627 | 629 | | |
628 | 630 | | |
| 631 | + | |
629 | 632 | | |
630 | 633 | | |
631 | 634 | | |
| |||
0 commit comments