Skip to content

Commit

Permalink
Merge branch '6.2' into 6.3
Browse files Browse the repository at this point in the history
* 6.2:
  [Serializer] Fix SerializedPath not working with constructor arguments
  [FrameworkBundle] Fix Workflow without a marking store definition uses marking store definition of previously defined workflow
  [HttpFoundation] UrlHelper is now aware of RequestContext changes
  UrlHelper is now aware of RequestContext changes
  [Process] Stop the process correctly even if underlying input stream is not closed:
  Fix get sender name in turbosms notifier
  [Notifier] Update AmazonSns url in doc from de to en
  [PropertyInfo] Fix `PhpStanExtractor` when constructor has no docblock
  [PropertyAccess] Fix nullsafe operator on array index
  • Loading branch information
nicolas-grekas committed May 19, 2023
2 parents 89ac295 + 97ae972 commit 8741e3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ public function wait(callable $callback = null): int

do {
$this->checkTimeout();
$running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen();
$running = $this->isRunning() && ('\\' === \DIRECTORY_SEPARATOR || $this->processPipes->areOpen());
$this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running);
} while ($running);

Expand Down
10 changes: 10 additions & 0 deletions Tests/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,16 @@ public function testEnvCaseInsensitiveOnWindows()
}
}

public function testNotTerminableInputPipe()
{
$process = $this->getProcess('echo foo');
$process->setInput(\STDIN);
$process->start();
$process->setTimeout(2);
$process->wait();
$this->assertFalse($process->isRunning());
}

private function getProcess(string|array $commandline, string $cwd = null, array $env = null, mixed $input = null, ?int $timeout = 60): Process
{
if (\is_string($commandline)) {
Expand Down

0 comments on commit 8741e3e

Please sign in to comment.