Skip to content

Commit 9c90f3c

Browse files
committed
Changed HttpConnectorTest to prevent forking on Unix systems.
1 parent 2b545b8 commit 9c90f3c

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

test/Functional/Porter/Net/Http/HttpConnectorTest.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,28 +86,21 @@ public function testDefaultTries()
8686
/**
8787
* @param string $script
8888
*
89-
* @return Process
89+
* @return Process Server.
9090
*/
9191
private function startServer($script)
9292
{
93-
$server = (new Process(sprintf('php -S %s %s.php', self::HOST, $script)))->setWorkingDirectory(self::$dir);
93+
$server = (
94+
// Prevent forking on some Unix systems.
95+
new Process(sprintf('%sphp -S %s %s.php', file_exists('/bin/sh') ? 'exec ' : '', self::HOST, $script))
96+
)->setWorkingDirectory(self::$dir);
9497
$server->start();
9598

9699
return $server;
97100
}
98101

99102
private function stopServer(Process $server)
100103
{
101-
/*
102-
* Bizarrely, process IDs are one less than they should be on Travis.
103-
* See https://github.com/symfony/symfony/issues/19611
104-
*/
105-
if (array_key_exists('TRAVIS', $_SERVER)) {
106-
posix_kill($server->getPid() + 1, SIGINT);
107-
108-
return;
109-
}
110-
111104
$server->stop();
112105
}
113106

0 commit comments

Comments
 (0)