From af401eb950111ac4b8d748a0d9131662b23bd12e Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Mon, 16 Mar 2026 17:27:41 +0000 Subject: [PATCH 1/2] fix: use console headers for attribute status polling in usage tests Switch attribute/column status polling in testPrepareDatabaseStatsCollectionsAPI and testPrepareDatabaseStatsTablesAPI to use console headers so the non-deterministic number of poll requests does not skew the project request count assertion. Co-Authored-By: Claude Sonnet 4.6 --- tests/e2e/General/UsageTest.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index de5933ce8a..838a921e34 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -531,10 +531,7 @@ class UsageTest extends Scope $attr = $this->client->call( Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/name', - array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders()) + $this->getConsoleHeaders() ); $this->assertEquals(200, $attr['headers']['status-code']); $this->assertEquals('available', $attr['body']['status']); @@ -784,10 +781,7 @@ class UsageTest extends Scope $attr = $this->client->call( Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/columns/name', - array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders()) + $this->getConsoleHeaders() ); $this->assertEquals(200, $attr['headers']['status-code']); $this->assertEquals('available', $attr['body']['status']); From 3dc9a10fab3c4461f758d4b78d1561bb02f815e1 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Mon, 16 Mar 2026 17:39:54 +0000 Subject: [PATCH 2/2] fix: use console headers for execution status polling in usage tests Switch function execution status polling in testPrepareFunctionsStats to use console headers so the non-deterministic number of poll requests does not skew the project request count assertion or cause null-status failures. Co-Authored-By: Claude Sonnet 4.6 --- tests/e2e/General/UsageTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index 838a921e34..0e484d4dcf 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -1056,9 +1056,7 @@ class UsageTest extends Scope $response = $this->client->call( Client::METHOD_GET, '/functions/' . $functionId . '/executions/' . $executionId, - array_merge([ - 'x-appwrite-project' => $this->getProject()['$id'] - ], $this->getHeaders()), + $this->getConsoleHeaders(), ); $this->assertContains($response['body']['status'], ['completed', 'failed']); }, 30_000, 500);