From 2c5dee0fddda7b9dd1fdc283ca0373eea86007b5 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 6 Feb 2026 04:03:40 +1300 Subject: [PATCH] fix: resolve test failures in Databases, Functions, Messaging, Storage - Fix typo CLient -> Client in DatabasesBase.php:4568 - Fix typo CLient -> Client in StorageCustomClientTest.php:428 - Fix cleanupFunction() call with extra parameter in FunctionsScheduleTest.php:175 - Increase message scheduling test timeouts from 30s to 180s for CI stability Co-Authored-By: Claude Opus 4.5 --- tests/e2e/Services/Databases/DatabasesBase.php | 2 +- .../Services/FunctionsSchedule/FunctionsScheduleTest.php | 2 +- tests/e2e/Services/Messaging/MessagingBase.php | 6 ++++-- tests/e2e/Services/Storage/StorageCustomClientTest.php | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index d4f3755074..6d70c4ae26 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4565,7 +4565,7 @@ trait DatabasesBase $this->assertEquals(401, $documentsUser2['headers']['status-code']); // Enable document permissions - $collection = $this->client->call(CLient::METHOD_PUT, $this->getContainerUrl($databaseId, $collectionId), [ + $collection = $this->client->call(Client::METHOD_PUT, $this->getContainerUrl($databaseId, $collectionId), [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] diff --git a/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php b/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php index 431afa0511..38ef30c971 100644 --- a/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php +++ b/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php @@ -172,7 +172,7 @@ class FunctionsScheduleTest extends Scope ]); $this->assertEquals(400, $execution['headers']['status-code']); - $this->cleanupFunction($functionId, $executionId); + $this->cleanupFunction($functionId); } public function testDeleteScheduledExecution() diff --git a/tests/e2e/Services/Messaging/MessagingBase.php b/tests/e2e/Services/Messaging/MessagingBase.php index 640dac757f..7b50fd2200 100644 --- a/tests/e2e/Services/Messaging/MessagingBase.php +++ b/tests/e2e/Services/Messaging/MessagingBase.php @@ -1182,6 +1182,7 @@ trait MessagingBase $this->assertEquals(MessageStatus::SCHEDULED, $message['body']['status']); $messageId = $message['body']['$id']; + // Use longer timeout for CI stability as scheduler interval may vary $this->assertEventually(function () use ($messageId) { $message = $this->client->call(Client::METHOD_GET, '/messaging/messages/' . $messageId, [ 'content-type' => 'application/json', @@ -1191,7 +1192,7 @@ trait MessagingBase $this->assertEquals(200, $message['headers']['status-code']); $this->assertEquals(MessageStatus::FAILED, $message['body']['status']); - }, 30000, 1000); + }, 180000, 1000); } public function testUpdateScheduledAt(): void @@ -1253,6 +1254,7 @@ trait MessagingBase $this->assertEquals(MessageStatus::SCHEDULED, $message['body']['status']); // Wait for message to be processed and fail + // Use longer timeout for CI stability as scheduler interval may vary $this->assertEventually(function () use ($messageId) { $message = $this->client->call(Client::METHOD_GET, '/messaging/messages/' . $messageId, [ 'content-type' => 'application/json', @@ -1262,7 +1264,7 @@ trait MessagingBase $this->assertEquals(200, $message['headers']['status-code']); $this->assertEquals(MessageStatus::FAILED, $message['body']['status']); - }, 30000, 1000); + }, 180000, 1000); } public function testSendEmail() diff --git a/tests/e2e/Services/Storage/StorageCustomClientTest.php b/tests/e2e/Services/Storage/StorageCustomClientTest.php index f823fea0df..8aba3aaf09 100644 --- a/tests/e2e/Services/Storage/StorageCustomClientTest.php +++ b/tests/e2e/Services/Storage/StorageCustomClientTest.php @@ -425,7 +425,7 @@ class StorageCustomClientTest extends Scope 'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'permissions.png'), ]); - $this->client->call(CLient::METHOD_PUT, '/storage/buckets/' . $bucketId . '/files/' . $fileId, [ + $this->client->call(Client::METHOD_PUT, '/storage/buckets/' . $bucketId . '/files/' . $fileId, [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], [