Skip to content

Commit

Permalink
CI time!
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Jun 21, 2021
1 parent 621b8ea commit 300df71
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ jobs:
fail-fast: false
matrix:
env:
- AUTOLOAD=0
# - AUTOLOAD=0
- AUTOLOAD=1
php-version:
- "5.6"
- "7.0"
- "7.1"
- "7.2"
# - "5.6"
# - "7.0"
# - "7.1"
# - "7.2"
- "7.3"
- "7.4"
# - "7.4"

steps:
- uses: actions/checkout@master
Expand Down
9 changes: 8 additions & 1 deletion tests/TestServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function startTestServer($code)
throw new \Exception("Error starting test server on pid {$pid}, command failed: {$command}");
}

// Todo: should this time out?
while ($r = \fgets($this->serverStderr)) {
if (\str_contains($r, 'started')) {
break;
Expand Down Expand Up @@ -106,7 +107,8 @@ public function stopTestServer()
++$n;
}
}
while (true) {

for ($i = 0; $i < 20; $i++) {
$status = \proc_get_status($this->serverProc);
if (!$status['running']) {
break;
Expand All @@ -120,6 +122,11 @@ public function stopTestServer()
\exec("kill {$pid}");
\usleep(100000);
}

if ($status['running']) {
throw new Exception("Could not kill test server");
}

// echo "Terminated test server on pid $pid\n";
\fclose($this->serverStderr);
\proc_close($this->serverProc);
Expand Down

0 comments on commit 300df71

Please sign in to comment.