Skip to content

Commit

Permalink
console: Make settle() indicate success/failure
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Grela <[email protected]>
  • Loading branch information
enkiusz committed May 13, 2024
1 parent 70232e4 commit 5e3815d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions labgrid/driver/consoleexpectmixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ def expect(self, pattern, timeout=-1):

@Driver.check_active
@step(args=['quiet_time'])
def settle(self, quiet_time, timeout=120.0):
def settle(self, quiet_time, timeout=120.0) -> bool:
t = Timeout(timeout)
while not t.expired:
try:
self.read(timeout=quiet_time)
except pexpect.TIMEOUT:
break
return True
return False

def resolve_conflicts(self, client):
for other in self.clients:
Expand Down

0 comments on commit 5e3815d

Please sign in to comment.