Skip to content

Commit

Permalink
test: fix hang when running tests that need parsing with --interactive
Browse files Browse the repository at this point in the history
When running tests with `--interactive` we don't redirect stdin, stdout
or stderr and instead pass them on to the user's console. This redirect
causes us to hang in case the test in question needs parsing, like it is
the case for TAP output, because we cannot read the process's stdout.

Fix this hang by not parsing output when running in interactive mode.
  • Loading branch information
pks-t committed Dec 5, 2024
1 parent 0efc339 commit 217629d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/mtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ async def _run_cmd(self, harness: 'TestHarness', cmd: T.List[str]) -> None:
env=self.runobj.env,
cwd=self.test.workdir)

if self.runobj.needs_parsing:
if self.runobj.needs_parsing and self.console_mode is not ConsoleUser.INTERACTIVE:
parse_coro = self.runobj.parse(harness, p.stdout_lines())
parse_task = asyncio.ensure_future(parse_coro)
else:
Expand Down

0 comments on commit 217629d

Please sign in to comment.