-
Notifications
You must be signed in to change notification settings - Fork 10.4k
feat: add race condition test for calendar-cache-serve booking flow #22401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add race condition test for calendar-cache-serve booking flow #22401
Conversation
- Reproduces double-booking when two guests book same timeslot 1-2s apart - Enables both calendar-cache and calendar-cache-serve feature flags - Uses parallel browser contexts to simulate concurrent booking attempts - Verifies both bookings succeed and create double-booking scenario Co-Authored-By: zomars@cal.com <zomars@me.com>
- Change page.waitForTimeout(1500) to use correct page context - Fix timeslot selection to ensure both contexts book same slot - Remove incorrect host assertion and add logging to demonstrate race condition - Test now successfully reproduces double-booking bug locally - Fixes 'end of central directory record signature not found' error Co-Authored-By: zomars@cal.com <zomars@me.com>
Signed-off-by: Omar López <zomars@me.com>
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
✅ No security or compliance issues detected. Reviewed everything up to 8825052. Security Overview
Detected Code Changes
Reply to this PR with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic found 1 issue across 1 file. Review it in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai
to give specific feedback.
await mockGoogleCalendarAPI(page2); | ||
|
||
// Navigate to booking page | ||
await page1.goto(`/org/${org.slug}/${team.slug}/${teamEvent.slug}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rule violated: E2E Tests Best Practices
Missing expect(page).toHaveurl("") after navigation violates the E2E test guideline to fail fast on unexpected redirects.
Graphite Automations"Add foundation team as reviewer" took an action on this PR • (07/11/25)1 reviewer was added to this PR based on Keith Williams's automation. |
E2E results are ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
- Recreate race condition test from PR #22401 for calendar-cache-serve booking flow - Replace hardcoded TEST_DATE with dynamic first available slot selection - Use getDynamicBookingDate function to select first available day dynamically - Prevent test flakiness by avoiding hardcoded tomorrow dates - Test validates concurrent booking prevention and cache functionality Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
…22401) Co-authored-by: zomars@cal.com <zomars@me.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* feat: add race condition test with dynamic date selection - Recreate race condition test from PR #22401 for calendar-cache-serve booking flow - Replace hardcoded TEST_DATE with dynamic first available slot selection - Use getDynamicBookingDate function to select first available day dynamically - Prevent test flakiness by avoiding hardcoded tomorrow dates - Test validates concurrent booking prevention and cache functionality Co-Authored-By: anik@cal.com <adhabal2002@gmail.com> * fix: replace dynamic date selection with fixed future date for efficiency Co-Authored-By: anik@cal.com <adhabal2002@gmail.com> * Revert "fix: replace dynamic date selection with fixed future date for efficiency" This reverts commit b4b7d35. --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
fix for revert #22400
What does this PR do?
Visual Demo (For contributors especially)
A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).
Video Demo (if applicable):
Image Demo (if applicable):
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist