test(realtime): create documents outside the coroutine in the concurrent traffic test by ChiragAgg5k · Pull Request #13840 · appwrite/appwrite · GitHub
Skip to content

test(realtime): create documents outside the coroutine in the concurrent traffic test - #13840

Merged
ChiragAgg5k merged 1 commit into
mainfrom
test/realtime-concurrent-creates
Sep 22, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
test/realtime-concurrent-creates

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Summary

testConcurrentRealtimeTrafficCoroutines created its six documents with the e2e client from inside Coroutine\run. Under Swoole's coroutine curl hook those curl_exec calls fail on CI without ever reaching the API (an instrumented run shows each POST returning in about 1ms with no status code), so the five receivers wait two seconds for events that were never triggered and the process dies with WebSocket\TimeoutException: Client read timeout. This is the same failure mode 3194210 removed from the client's concurrent requests.

The test now races the creates through Client::callConcurrently (curl_multi, no coroutine), keeps the five receivers as coroutines draining the already-buffered frames, and moves every assertion outside the scheduler so a failure is reported instead of killing the process.

The flake has been hitting Tests / E2E / PostgreSQL (dedicated) / Realtime on main (for example run 35618367153 on 2026-09-21) and blocked #13731 five times in a row today; a main run instrumented the same way failed identically (run 35738423645).

Validation

Local PostgreSQL stack: the test passes 3/3 in isolation and inside the full RealtimeCustomClientTest class; Pint clean.

Part of #13828.

…ent traffic test

curl under Swoole's coroutine hook fails on CI without reaching the API,
so the six creates never happened and every receiver timed out waiting
for events. Race the creates through the client's curl_multi batch
instead, keep the five receivers as coroutines, and move every assertion
outside the scheduler so a failure is reported instead of killing the
process. The same pattern was removed from the client in 3194210.

(cherry picked from commit f48b9fe)
@greptile-apps

greptile-apps Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → test/realtime-concurrent-creates (after).

Metric Before After Change
🚀 Requests/sec 197.57 202.75 ⚪ +2.6%
⏱️ Latency P50 87.21 ms 87.07 ms ⚪ -0.2%
⏱️ Latency P95 207.37 ms 195.25 ms 🟢 -5.8%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 87.07 195.25 12,540 202.75 -12.11
Account 162.34 299.87 660 11.25 -7.1
TablesDB 84.81 153.98 6,820 112.56 -7.53
Storage 79.1 170.92 3,300 56.39 -8.38
Functions 121.63 240.61 1,760 30.72 -3.48

Top API waits (after)

API request Max wait (ms)
storage.files.preview 442.35
account.prefs.update 405.49
account.name.update 401.96
functions.delete 353.98
tablesdb.rows.delete 353.39

@ChiragAgg5k
ChiragAgg5k merged commit c8ef6a8 into main Sep 22, 2026
90 of 96 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the test/realtime-concurrent-creates branch September 22, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant