potiuk commented on code in PR #44755:
URL: https://github.com/apache/airflow/pull/44755#discussion_r1876800996


##########
tests/executors/test_executor_loader.py:
##########
@@ -146,6 +146,11 @@ def test_get_hybrid_executors_from_config(self, 
executor_config, expected_execut
             assert executors == expected_executors_list
 
     def test_init_executors(self):
+        # We need to init provider config in order to import CeleryExecutor
+        ProvidersManager().initialize_providers_configuration()
+
+        from airflow.providers.celery.executors.celery_executor import 
CeleryExecutor
+

Review Comment:
   Looks like caching issue.
   
   Possibly the "cleanup_providers_manager" should (at least temporary) fix the 
problem? I guess ProvidersManager is initialized in import and then cache is 
used. 
   
   ProvidersManager uses caching extensively to speed up things, and 
`cleanup_providers_managers` cleans the cache on top of reloading it:
   
   ```python
   @pytest.fixture
   def cleanup_providers_manager():
       from airflow.providers_manager import ProvidersManager
   
       ProvidersManager()._cleanup()
       ProvidersManager().initialize_providers_configuration()
       try:
           yield
       finally:
           ProvidersManager()._cleanup()
   ```



-- 
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]

Reply via email to