feat(k1): add USB networking, device management and acquisition recovery
This commit is contained in:
@@ -306,10 +306,13 @@ class FakeExecutor:
|
||||
observed: Any,
|
||||
*,
|
||||
reconciled_active_observed: Any | None = None,
|
||||
standby_work: Callable[[], None] | None = None,
|
||||
) -> str | None:
|
||||
self.records.append(f"wait:{event}")
|
||||
deadline = time.monotonic() + 2.0
|
||||
while not observed():
|
||||
if standby_work is not None:
|
||||
standby_work()
|
||||
if (
|
||||
reconciled_active_observed is not None
|
||||
and reconciled_active_observed()
|
||||
@@ -372,8 +375,12 @@ class FakeExecutor:
|
||||
def maintain_post_stop_until_standby(self) -> None:
|
||||
self.records.append("wait:device-standby")
|
||||
|
||||
def maintain_standby_until_next_acquisition(self, requested: Callable[[], bool]) -> None:
|
||||
def maintain_standby_until_next_acquisition(
|
||||
self, requested: Callable[[], bool], *, standby_work: Callable[[], None] | None = None,
|
||||
) -> None:
|
||||
while not requested():
|
||||
if standby_work is not None:
|
||||
standby_work()
|
||||
if self.transport.state == "closed":
|
||||
raise RuntimeError("test transport closed")
|
||||
if not self.transport.proof_fresh:
|
||||
|
||||
Reference in New Issue
Block a user