Fix CI/CD flaky test

This commit is contained in:
Matej Bačo
2025-03-17 14:16:31 +01:00
parent 86b66d70bf
commit 4de935a322
+6 -25
View File
@@ -882,29 +882,12 @@ class UsageTest extends Scope
$this->assertEquals(201, $response['headers']['status-code']);
$this->assertNotEmpty($response['body']['$id']);
$response = $this->client->call(
Client::METHOD_POST,
'/functions/' . $functionId . '/deployments',
array_merge([
'content-type' => 'multipart/form-data',
'x-appwrite-project' => $this->getProject()['$id']
], $this->getHeaders()),
[
'entrypoint' => 'index.php',
'code' => $this->packageFunction('php'),
'activate' => true,
]
);
$deploymentId = $response['body']['$id'] ?? '';
$this->assertEquals(202, $response['headers']['status-code']);
$this->assertNotEmpty($response['body']['$id']);
$this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['$createdAt']));
$this->assertEquals('index.php', $response['body']['entrypoint']);
// Wait for deployment to build.
sleep(self::WAIT + 20);
$deploymentId = $this->setupDeployment($functionId, [
'entrypoint' => 'index.php',
'code' => $this->packageFunction('php'),
'activate' => true,
]);
$this->assertNotEmpty($deploymentId);
$response = $this->client->call(
Client::METHOD_PATCH,
@@ -917,8 +900,6 @@ class UsageTest extends Scope
'deploymentId' => $deploymentId,
],
);
\var_dump($response);
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertNotEmpty($response['body']['$id']);