damccorm commented on code in PR #41824:
URL: https://github.com/apache/beam/pull/41824#discussion_r4748335063


##########
sdks/python/apache_beam/runners/interactive/interactive_beam_test.py:
##########
@@ -909,6 +909,7 @@ def test_async_computation_result_cancel(self):
     # This part is hard to test without deeper runner integration
     with self.assertRaises(TimeoutError):
       async_result.result(timeout=1)  # It should not complete successfully
+    async_result.wait_for_completion(timeout=30)

Review Comment:
   Good catch on cleanup safety — I wrapped the post-`ib.compute()` assertions 
in `try ... finally:` so `async_result.wait_for_completion(timeout=30)` always 
drains the background thread before `isolated_env` teardown even if an earlier 
assertion fails. Kept the pre-existing `time.sleep(0.1)` / 
`mock_pipeline_result` setup unchanged so this PR stays minimal and strictly 
scoped to the leaked background thread.



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