[ 
https://issues.apache.org/jira/browse/BEAM-3861?focusedWorklogId=82431&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-82431
 ]

ASF GitHub Bot logged work on BEAM-3861:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Mar/18 19:39
            Start Date: 20/Mar/18 19:39
    Worklog Time Spent: 10m 
      Work Description: markflyhigh commented on a change in pull request 
#4874: [BEAM-3861] Improve test infra in Python SDK for streaming end-to-end 
test
URL: https://github.com/apache/beam/pull/4874#discussion_r175897788
 
 

 ##########
 File path: sdks/python/apache_beam/testing/test_utils.py
 ##########
 @@ -129,3 +131,47 @@ def delete_files(file_paths):
     raise RuntimeError('Clean up failed. Invalid file path: %s.' %
                        file_paths)
   FileSystems.delete(file_paths)
+
+
+def wait_for_subscriptions_created(subs, timeout=60):
+  """Wait for all PubSub subscriptions are created."""
+  return _wait_until_all_exist(subs, timeout)
+
+
+def wait_for_topics_created(topics, timeout=60):
+  """Wait for all PubSub topics are created."""
+  return _wait_until_all_exist(topics, timeout)
+
+
+def _wait_until_all_exist(components, timeout):
+  need_wait = set(components)
+  start_time = time.time()
+  while time.time() - start_time <= timeout:
+    for c in components:
 
 Review comment:
   If I replace `components` with `needs_wait` in line 150, I'll get:
   
   RuntimeError: Set changed size during iteration.
   
   guess we cannot modify set during iteration.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 82431)
    Time Spent: 2h 20m  (was: 2h 10m)

> Build test infra for end-to-end streaming test in Python SDK
> ------------------------------------------------------------
>
>                 Key: BEAM-3861
>                 URL: https://issues.apache.org/jira/browse/BEAM-3861
>             Project: Beam
>          Issue Type: Task
>          Components: testing
>            Reporter: Mark Liu
>            Assignee: Mark Liu
>            Priority: Major
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to