Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions build/integration/features/bootstrap/FederationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ public function startFederatedServer(): void {
$port = getenv('PORT_FED');

self::$phpFederatedServerPid = exec('PHP_CLI_SERVER_WORKERS=2 php -S localhost:' . $port . ' -t ../../ >/dev/null & echo $!');

// Wait until the server accepts connections, as the following hooks
// (like the user cleanup) send requests to it right away.
for ($i = 0; $i < 100; $i++) {
$socket = @fsockopen('localhost', (int)$port);
if ($socket !== false) {
fclose($socket);
return;
}
usleep(100000);
}
}

/**
Expand Down
Loading