Skip to content

Commit

Permalink
progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
amit lissack committed Oct 26, 2021
1 parent 042ff36 commit f8047fa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ async def connect(
for i in range(retries):
try:
r, w = await asyncio.open_connection(host=host, port=port)
break
except OSError:
await asyncio.sleep(interval_seconds)

Expand Down
2 changes: 1 addition & 1 deletion api/src/opentrons/hardware_control/emulation/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ModuleServerSettings(BaseModel):
"""Settings for the module server"""

host: str = "0.0.0.0"
port: int = 8888
port: int = 8989


class Settings(BaseSettings):
Expand Down
12 changes: 8 additions & 4 deletions g-code-testing/g_code_parsing/g_code_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ def _get_loop() -> asyncio.AbstractEventLoop:
@staticmethod
def _start_emulation_app(emulator_settings: Settings) -> Process:
"""Start emulated OT-2"""
modules = [ModuleType.Thermocycler, ModuleType.Temperature, ModuleType.Magnetic]
modules = [ModuleType.Magnetic, ModuleType.Temperature, ModuleType.Thermocycler]

def runit():
def _run_app():
asyncio.run(
run_app.run(emulator_settings, modules=[m.value for m in modules])
)

proc = Process(target=runit)
proc = Process(target=_run_app)
proc.daemon = True
proc.start()

Expand All @@ -80,7 +80,11 @@ async def _wait_ready() -> None:
await wait_emulators(client=c, modules=modules, timeout=5)
c.close()

ready_proc = Process(target=lambda: asyncio.run(_wait_ready()))
def _run_wait_ready():
asyncio.run(_wait_ready())

ready_proc = Process(target=_run_wait_ready)
ready_proc.daemon = True
ready_proc.start()
ready_proc.join()

Expand Down

0 comments on commit f8047fa

Please sign in to comment.