Commit Graph

57 Commits

Author SHA1 Message Date
ArnabChatterjee20k bc224de751 Add userId to connection info in Realtime adapter and simplify userId fetching 2026-04-07 17:35:48 +05:30
loks0n cf7710b580 perf: reduce WebSocket timeout in realtime tests from 45s to 2s
Realtime E2E tests were taking 24+ minutes due to intentional timeout waits. Many tests verify event filtering by expecting a TimeoutException, and each was waiting 45 seconds.

Changes:
- Reduce default WebSocket timeout from 45s to 2s in RealtimeBase
- Add optional timeout parameter to getWebsocket() methods
- Use longer timeouts (5-10s) for tests that legitimately wait for slow operations (function executions, test channel events)
- Use named parameters for improved readability

Performance impact:
- Before: 24:07 minutes (1,447 seconds)
- After: 1:09 minutes (69 seconds)
- Speedup: ~21x faster

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-03 22:47:28 +00:00
copilot-swe-agent[bot] 339ecc418d test: remove testConnectionFailureRegionMismatch and mock PATCH route
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-26 12:46:47 +00:00
copilot-swe-agent[bot] 5ff7e2af24 fix: revert regions.php, add mock PATCH route for project region in tests
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-26 12:31:05 +00:00
copilot-swe-agent[bot] 9aa47c267d test: add region mismatch failure test and fra region to config
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-26 12:14:23 +00:00
copilot-swe-agent[bot] 952f48c72a fix: use AppwriteException, fix console region, add region check test
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-26 11:55:15 +00:00
Jake Barnby 7df86a3838 fix: cast attribute defaults after queue deserialization and improve test robustness
- Fix float/int/bool attribute creation failures caused by type loss
  during queue serialization in the Databases worker
- Rework session limit test to retry session creation for cache
  propagation in shared mode
- Increase GraphQL attribute polling timeouts from 30s to 60s
- Increase SchemaPolling waitForAllAttributes timeout to 180s
- Increase Realtime WebSocket client timeout from 30s to 45s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:02:23 +13:00
Jake Barnby 31f4260908 fix: increase database worker count and test resilience for parallel execution
Parallel test execution via ParaTest creates more queue load than a single
database worker can handle, causing attributes to get stuck at 'processing'.
Increase _APP_WORKERS_NUM to 4 to match parallelism, increase WebSocket
timeout from 15s to 30s, and add retry logic for proxy requests in Sites tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:16:40 +13:00
Jake Barnby 9796c46975 fix: misplaced assertion in testUpdateAttributeEnum and reduce timeouts
- Move maxLength/assertStringContainsString from testUpdateAttributeEnum
  back to testPatchAttribute where $attribute is defined
- Fix remaining $data['moviesId'] -> $moviesId in testCreateAttributes
- Reduce WebSocket timeout from 30s to 15s for faster failure detection
- Reduce Realtime helper assertEventually from 30s to 15s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 15:07:05 +13:00
Jake Barnby acad17f3b8 fix: resolve test failures and reduce excessive timeouts
- DatabasesBase: fix 5 merge corruption issues (missing integers2 attr,
  undefined vars, wrong assertion, wrong setup method)
- WebhooksBase: increase deployment build timeout from 10s to 120s
- RealtimeBase: reduce WebSocket timeout 120s→30s, fix deprecated nullable
- RealtimeConsoleClientTest: reduce assertEventually 120s→30s
- SchemaPolling: reduce all default timeouts 600s→60s
- SitesBase: reduce build timeout 300s→120s, activation 200s→60s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 14:23:42 +13:00
Jake Barnby 7d5f6c9bf3 Merge remote-tracking branch 'origin/1.8.x' into feat-db-tests
# Conflicts:
#	.github/workflows/tests.yml
#	composer.lock
#	tests/e2e/Services/Projects/ProjectsConsoleClientTest.php
#	tests/e2e/Services/Teams/TeamsCustomClientTest.php
2026-02-12 12:34:42 +13:00
ArnabChatterjee20k 81f4d10ad6 Enhance Realtime channel handling for project queries and improve test coverage 2026-02-09 11:48:04 +05:30
Jake Barnby d617f89642 fix: Fix parallel test failures across Databases, GraphQL, Realtime, and Account
- DatabasesBase: Wait for twoWayKey attribute on library collection in
  setupOneToManyRelationship; use server API key headers for document creation
- DatabasesStringTypesTest: Add delays between attribute creation batches to
  avoid overwhelming the database worker
- SchemaPolling: Improve waitForAllAttributes error messaging
- GraphQL UsersTest: Use fresh user in testDeleteUserSession to avoid
  session conflicts
- Realtime: Increase WebSocket timeout to 120s and index polling to 60s
- Account: Add better error reporting for phone session creation failures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 16:08:55 +13:00
Jake Barnby 161e4e53d4 fix: Address remaining parallel-safety failures across all test suites
- Fix Legacy DatabasesStringTypesTest with project-keyed setup cache
- Fix Account OTP test with unique email, phone session re-login
- Fix GraphQL setup methods with sleep, 409 handling, missing columns
- Fix Databases list/pagination tests with document ID filtering
- Fix Permissions tests with assertGreaterThanOrEqual for counts
- Fix Messaging scheduled tests to not depend on scheduler timing
- Increase Realtime WebSocket timeout to 60s and assertEventually to 30s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 14:20:42 +13:00
ArnabChatterjee20k d18d4d8263 updated subscription process 2026-02-03 11:43:23 +05:30
ArnabChatterjee20k 3c2f0cc982 updated to new slot based filtering for realtime 2026-02-02 21:50:23 +05:30
ArnabChatterjee20k 6e576b5140 added realtime query new channel and channel wise filters 2026-02-02 19:45:21 +05:30
ArnabChatterjee20k b7e2606b9f Enhance Realtime functionality with query support and improve tests
- Updated Realtime adapter to handle queries during subscription.
- Added query filtering capabilities in RuntimeQuery class.
- Modified RealtimeBase and RealtimeCustomClientTest to support query parameters in WebSocket connections.
- Improved test coverage for account and database channels with queries.
2025-12-22 18:01:00 +05:30
loks0n f765eb92e7 feat: cors service 2025-12-11 09:01:31 +00:00
Jake Barnby b2fa28754d Merge remote-tracking branch 'origin/1.7.x' into 1.8.x
# Conflicts:
#	.github/workflows/benchmark.yml
#	composer.lock
#	src/Appwrite/Event/Database.php
2025-07-04 10:00:45 -04:00
Darshan f94ecc885a fix: tests as per new events system. 2025-04-27 10:36:21 +05:30
loks0n 2427f950b5 fix: realtime 2025-04-14 14:34:22 +01:00
Torsten Dittmann e6d8221c89 tests(realtime): fix argument types 2024-09-30 17:08:17 +02:00
Torsten Dittmann 0a1d572c72 chore: run formatter 2024-03-06 18:34:21 +01:00
Torsten Dittmann 658d2e0855 tests: fix realtime tests 2022-02-22 18:01:03 +01:00
kodumbeats 7ddcf4142e Briefly sleep to give realtime a chance to disconnect 2022-01-21 12:53:13 -05:00
Torsten Dittmann 473fdf451e fix: realtime startup 2022-01-03 15:06:40 +01:00
Torsten Dittmann a24702b4e1 fix: realtime tests 2022-01-03 15:01:35 +01:00
Torsten Dittmann ae967839e1 fix: realtime racecondition 2022-01-03 14:42:49 +01:00
Torsten Dittmann e944da2f3e feat(realtime): add console channel 2021-12-06 13:03:12 +01:00
Torsten Dittmann fba2529539 fix(tests): realtime tests 2021-11-24 17:44:11 +01:00
Torsten Dittmann a585a9090a fix realtime with db refactor 2021-10-07 17:35:17 +02:00
Torsten Dittmann 821aa45d7d add tests against failure 2021-08-27 11:31:26 +02:00
Torsten Dittmann dc79be6b50 adapt messages and tests 2021-08-27 11:20:49 +02:00
Torsten Dittmann 67ae70ed69 update tests 2021-08-27 10:20:44 +02:00
Torsten Dittmann 4695ea9914 fix(tests): realtime with functions 2021-08-18 12:49:34 +02:00
Torsten Dittmann e2948ea02f debug failing tests 2021-08-18 12:28:17 +02:00
Torsten Dittmann 39e91037df debug failing tests 2021-08-18 12:25:25 +02:00
Torsten Dittmann 889d6aa1c0 tests(realtime): adapt account channel 2021-07-26 11:05:42 +02:00
Torsten Dittmann 923d373b6d introduce utopia-php/websocket 2021-06-24 14:22:32 +02:00
Torsten Dittmann 43036a9ba6 feat(realtime): add membership events 2021-06-17 11:37:52 +02:00
Torsten Dittmann 6ebf6bd155 feat(realtime): team events and permission validation 2021-06-16 19:43:06 +02:00
Torsten Dittmann 505877475a fix tests 2021-03-24 17:30:23 +01:00
Torsten Dittmann 5baca432a8 fix tests 2021-03-24 17:27:59 +01:00
Torsten Dittmann ae8061b5ca fix tests 2021-03-24 17:25:07 +01:00
Torsten Dittmann 85d13bf801 fix tests 2021-03-24 17:20:06 +01:00
Torsten Dittmann 14070b3296 fix tests 2021-03-24 17:08:07 +01:00
Torsten Dittmann 52f3312230 fix tests 2021-03-24 17:05:50 +01:00
Torsten Dittmann 2083c5bc89 push tests 2021-03-24 17:01:43 +01:00
Torsten Dittmann 6d10550be8 add api key to admin calls on tests 2021-03-24 16:56:42 +01:00