Repository navigation
test: wait for the presence sync before the RTP8 lifecycle enters - #730
owenpearson wants to merge 1 commit into
Conversation
The sandbox answers the first attach to a new channel with HAS_PRESENCE and syncs about 80ms later. An enter landing in that window reaches the observer inside the SYNC as PRESENT, ahead of the live ENTER, which is how test_rtp8_enter_update_leave_lifecycle has been failing in CI. The specification omits the wait; filed as ably/specification#564. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe realtime presence lifecycle test now waits for client B’s initial presence sync before client A attaches. The deviations record adds the race as issue ChangesPresence lifecycle test
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Other Merge Risk: ⚪ Minimal · up to The test now waits for client B’s initial presence sync before client A attaches, preventing the documented PRESENT-before-ENTER ordering race. No actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. I’m a rabbit, ears held high, Comment |
test/uts/realtime/integration/presence_lifecycle_test.py::test_rtp8_enter_update_leave_lifecyclefails intermittently in CI with
assert 1 == 2: client B's first presence event is PRESENTrather than ENTER. It failed six times between 2026-10-01 and 2026-10-08, on 3.10 to 3.14,
on
main-based branches and onintegration/v4.The sandbox answers the first attach to a new channel with HAS_PRESENCE, even though the
channel is empty, and follows it with a SYNC about 80ms later. When client A's enter reaches
the server inside that window, the SYNC carries the member to client B as PRESENT, just
ahead of the live ENTER:
The ENTER carries the same id and is discarded as a duplicate, as ably-js discards it, so
the SDK is behaving correctly. The specification's steps go straight from client B's attach
to client A's enter without waiting for client B's sync, and ably-js's derived test makes
the same assumption. Filed as ably/specification#564.
The test now waits for client B's sync with
presence.get()(RTP11c1) before client Aattaches, under a
# UTS SPEC ERROR:comment, and keeps every assertion. The legacy suite'sawait_presence_sync()intest/ably/realtime/realtimepresence_test.pydoes the same forthe same reason.
deviations.mdrecords the fault among therealtime/integrationspecerrors.
Verification
Every channel
ProtocolMessageboth clients received was recorded while client A's enterwas sent a fixed delay after client B's ATTACHED, swept from 50 to 105ms, three passes per
delay under each protocol:
Without a delay it did not fail in 72 local runs, because local latency puts the enter
ahead of the SYNC. The test file passes 15 runs in a row under both protocols, and
ruff checkis clean.🤖 Generated with Claude Code
Summary by CodeRabbit