RTC: add WebSocket e2e tests that do not run in CI#77920
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
2252bf4 to
2dc0f29
Compare
2dc0f29 to
cbb630e
Compare
|
@danluu Great idea getting the Gutenberg tests running with WebSockets! I'd like to make a change to this branch to use the official y-websocket-server as a backend instead of the bespoke server implemented in rtc-test-ws-sync-server.mjs. I'll follow up with a link to that PR. I'm not sure if it will improve test results, but it will better match the VIP implementation, and handle things like the Yjs sync handshake and awareness updates in the same way we'd expect in production. |
|
I've opened up a follow-up PR in #78179 with the official Yjs transport and some config simplifications. |
|
I'm closing this, as the follow-up PR #78179 includes your commits and has been merged. |
This is part of an AI fuzzing project, where an AI wrote a fuzzer and then triages bugs from the fuzzer and creates fixes. See #77716 for the tracking issue.
What?
This ports existing RTC e2e tests to use WebSockets and adds an additional test.
Why?
I tried adding WebSockets support to the #77716 fuzzer because the world's largest deployment of Gutenberg RTC uses WebSockets. On adding WS support, the fuzzer immediately found what appear to be a large number of distinct bugs. Users are reporting issues and some of the bugs the fuzzer turned up have symptoms that are very similar to issues users have reported. It's likely that some of the bugs that are turned up are issues users are seeing (although we can't tell for sure with the instrumentation we have).
I then tried porting (that is, had my AI agent port) the existing HTTP e2e tests to WS and found that two failed. On applying all outstanding fixes from #77716, this fixed 1.95 of the tests (one test would fail 1 in 20 times in what seems to be a real failure that's non-determinstic for timing reasons).
I'd like to a submit a PR to fix the bug causing that failure, but I think it makes sense to have all of these tests available to run and this is a large enough diff that, although I don't know what the standards/norms are for Gutenberg, my inclination would be to split it out into a separate diff and then have that PR fix this PR.
These tests do not attempt to run in CI because I'm presuming there's some kind of "Chesterton's Fence" reason we don't have WS RTC support in CI today. If that's an incorrect assumption, this PR could be modified to try to run WS tests in CI. I don't know if WS is blocked in CI, but Storybook CI seems to run a TCP server and talk to it and WS runs over TCP, so it seems like it should be do-able?
Testing Instructions
Setup, if necessary:
Run non-determistically failing test many times:
As noted above, this PR is test only and doesn't include the fix for the e2e WS tests, so these tests are expected to fail.
Use of AI Tools
As noted above, this is an AI generated PR for an AI fuzzing project.