Fix flaky realtime tests#12543
Conversation
Adds timeout parameter to getWebsocket() calls to prevent indefinite hanging. Re-authenticates session after password recovery in testChannelAccount to ensure valid auth state.
Greptile SummaryThis PR addresses two causes of flaky realtime E2E tests: adding explicit timeout parameters to
Confidence Score: 3/5Safe to merge only after restoring or fully removing the broken testChannelDatabaseTransaction setup; as-is the test will fail with undefined-variable errors. The timeout additions and re-auth fix are correct, but the partial removal of the transaction-create setup block in testChannelDatabaseTransaction leaves $databaseId, $collectionId, and $documentId undefined throughout the rest of the method and causes the connected-message assertions to test the wrong response shape. tests/e2e/Services/Realtime/RealtimeCustomClientTest.php — specifically the testChannelDatabaseTransaction method starting at line 3159 Important Files Changed
|
What does this PR do?
Fixes flaky E2E realtime tests by addressing two issues:
WebSocket timeouts: Added timeout parameter to all \getWebsocket()\ calls in both \RealtimeConsoleClientTest\ and \RealtimeCustomClientTest\ to prevent tests from hanging indefinitely when the WebSocket connection fails to establish.
Session re-authentication: In \ estChannelAccount, the test performs a password recovery flow which invalidates the current session. Added explicit re-authentication to ensure subsequent WebSocket connections use a valid auth token.
Related issues
Fixes #12540