Skip to content
Merged
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
9 changes: 7 additions & 2 deletions tests/e2e/ExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,11 @@ public function testRestartPolicy(): void
'runtimeEntrypoint' => 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $command . '"',
'restartPolicy' => 'always'
]);
$this->assertEquals(500, $response['headers']['status-code']);
// The runtime reports the function's exit() as a failed execution, so the
// executor call itself succeeds and carries statusCode 500. The server
// process still dies afterwards, which is what the restart count asserts.
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals(500, $response['body']['statusCode']);

\sleep(5);

Expand All @@ -807,7 +811,8 @@ public function testRestartPolicy(): void
'image' => 'openruntimes/php:v5-8.1',
'runtimeEntrypoint' => 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $command . '"'
]);
$this->assertEquals(500, $response['headers']['status-code']);
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals(500, $response['body']['statusCode']);

\sleep(5);

Expand Down