Retry running the agent in pytest on EBADF
@@ -159,9 +159,11 @@ def get_unique_localhost():
@contextmanager
def run_subprocess(command: List[str], env: Dict[Any, Any] = None, **kwargs):
# subprocess on Windows has a bug where it doesn't like Path.
- proc = subprocess.Popen(
+ proc = retry_on_ebadf(
+ lambda: subprocess.Popen(
[str(c) for c in command], env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs
)
+ )()
get_output = pull_from_reader_in_background(proc.stdout)
