skymensch commented on code in PR #64743:
URL: https://github.com/apache/airflow/pull/64743#discussion_r3128512405


##########
task-sdk/tests/task_sdk/execution_time/test_supervisor.py:
##########
@@ -2618,6 +2618,12 @@ def test_handle_requests(
         req_frame = _RequestFrame(id=randint(1, 2**32 - 1), 
body=message.model_dump())
         generator.send(req_frame)
 
+        # SetXCom is offloaded to a thread to avoid blocking the event loop.
+        # We need to wait for the future and drain it before reading the 
response.
+        if isinstance(message, SetXCom):
+            watched_subprocess._request_thread_pool.shutdown(wait=True)
+            watched_subprocess._drain_pending_requests()

Review Comment:
   Fixed in the latest commit: replaced shutdown(wait=True) with 
concurrent.futures.wait() so the ThreadPoolExecutor remains usable for 
subsequent SetXCom submissions within the same test.



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