diff --git a/tests/e2e/ExecutorTest.php b/tests/e2e/ExecutorTest.php index 73e716f..4eef357 100644 --- a/tests/e2e/ExecutorTest.php +++ b/tests/e2e/ExecutorTest.php @@ -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); @@ -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);