fix(e2e): stop Databases testTimeout hanging on 12MB HTTP setup POSTs (#13339)

* fix(e2e): stop testTimeout hanging on Expect 100-continue

Databases PostgreSQL e2e flakes in testTimeout setup: ten ~12MB document
POSTs stall libcurl's Expect: 100-continue handshake (status 100, 0 bytes,
120s) before the 408 assertion. Disable Expect on the test client and keep
the fixture well under Swoole's 12MiB package_max_length.

Co-authored-by: Chirag Aggarwal <chiragaggarwal5k@gmail.com>

* fix(e2e): keep testTimeout under Swoole's 12MiB HTTP ceiling

Disabling Expect: 100-continue changed the flake from status 100 to
status 0 — ten ~12MB creates still hang under paratest --processes 3.
Use a 1MiB slice and Query::contains so the 1ms statement_timeout still
yields 408 without posting at package_max_length.

Co-authored-by: Chirag Aggarwal <chiragaggarwal5k@gmail.com>

* fix(e2e): drop global Expect header that 413s Storage uploads

Empty Expect: made curl send multipart bodies immediately. Traefik/Swoole
RST the connection, so Client threw on testCreateBucketFile instead of
returning 413. testTimeout is fixed by the 1MiB slice and contains() query.

Co-authored-by: Chirag Aggarwal <chiragaggarwal5k@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
Chirag AggarwalandCursor Agent authored and GitHub committed 2026-08-25 18:22:27 +05:30
1 parent cec57f2d7a
commit e75d5c3f13
1 file changed
+11 -3
+11 -3
View File
@@ -7631,14 +7631,21 @@ trait DatabasesBase
$this->waitForAttribute($data['databaseId'], $data['$id'], 'longtext');
}
// The fixture is ~12MB, just under Swoole's 12MiB package_max_length /
// output_buffer_size. Ten concurrent HTTP creates of that size never
// complete under paratest (curl: 0 bytes, 120s) — isolated they take ~1s
// each. A 1MiB slice plus contains() still exceeds statement_timeout=1ms
// (notEqual on 1MiB returned 200 on DocumentsDB).
$longtext = substr(file_get_contents(__DIR__ . '/../../../resources/longtext.txt'), 0, 1024 * 1024);
for ($i = 0; $i < 10; $i++) {
$this->client->call(Client::METHOD_POST, $this->getRecordUrl($data['databaseId'], $data['$id']), array_merge([
$document = $this->client->call(Client::METHOD_POST, $this->getRecordUrl($data['databaseId'], $data['$id']), array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
$this->getRecordIdParam() => ID::unique(),
'data' => [
'longtext' => file_get_contents(__DIR__ . '/../../../resources/longtext.txt'),
'longtext' => $longtext,
],
'permissions' => [
Permission::read(Role::user($this->getUser()['$id'])),
@@ -7646,6 +7653,7 @@ trait DatabasesBase
Permission::delete(Role::user($this->getUser()['$id'])),
]
]);
$this->assertEquals(201, $document['headers']['status-code']);
}
$response = $this->client->call(Client::METHOD_GET, $this->getRecordUrl($data['databaseId'], $data['$id']), array_merge([
@@ -7654,7 +7662,7 @@ trait DatabasesBase
'x-appwrite-timeout' => 1,
], $this->getHeaders()), [
'queries' => [
Query::notEqual('longtext', 'appwrite')->toString(),
Query::contains('longtext', ['needle-that-does-not-exist'])->toString(),
],
]);