Browse Source

Revert "mavsdk_tests: retry gz model spawn command"

This reverts commit c15d3f7cfa.
master
Julian Oes 3 years ago committed by Daniel Agar
parent
commit
199b5e7d48
  1. 27
      test/mavsdk_tests/process_helper.py

27
test/mavsdk_tests/process_helper.py

@ -8,7 +8,6 @@ import subprocess
import shutil import shutil
import threading import threading
import errno import errno
import select
from typing import Any, Dict, List, TextIO, Optional from typing import Any, Dict, List, TextIO, Optional
@ -68,22 +67,16 @@ class Runner:
def process_output(self) -> None: def process_output(self) -> None:
assert self.process.stdout is not None assert self.process.stdout is not None
while True:
poll_obj = select.poll() line = self.process.stdout.readline()
poll_obj.register(self.process.stdout, select.POLLIN) if not line and \
(self.stop_thread.is_set() or self.poll is not None):
while not self.stop_thread.is_set(): break
poll_result = poll_obj.poll(0) if not line or line == "\n":
if poll_result: continue
line = self.process.stdout.readline() self.output_queue.put(line)
if not line and \ self.log_fd.write(line)
(self.stop_thread.is_set() or self.poll is not None): self.log_fd.flush()
break
if not line or line == "\n":
continue
self.output_queue.put(line)
self.log_fd.write(line)
self.log_fd.flush()
def poll(self) -> Optional[int]: def poll(self) -> Optional[int]:
return self.process.poll() return self.process.poll()

Loading…
Cancel
Save