Skip to content

Commit

Permalink
tests: wait for connection to server
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeCrassous committed May 3, 2021
1 parent 565a805 commit 89a35e4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/blender_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,23 @@
from mixer.bl_preferences import set_log_level
set_log_level(None, {log_level})
"""

# wait a bit for the server to get started
_connect = """
import bpy
bpy.ops.mixer.connect()
import time
timeout = 10
end_time = time.monotonic() + timeout
while True:
try:
bpy.ops.mixer.connect()
except RuntimeError as e:
print ("Connect failed, retry", repr(e))
if time.monotonic() > end_time:
raise
time.sleep(0.1)
else:
break
"""

_disconnect = """
Expand Down

0 comments on commit 89a35e4

Please sign in to comment.