feat: add race condition test for calendar-cache-serve booking flow#22401
Merged
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 |
Contributor
There was a problem hiding this comment.
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}`); |
Contributor
There was a problem hiding this comment.
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. |
Contributor
E2E results are ready! |
devin-ai-integration bot
added a commit
that referenced
this pull request
Jul 15, 2025
- 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>
5 tasks
alishaz-polymath
pushed a commit
that referenced
this pull request
Jul 16, 2025
…22401) Co-authored-by: zomars@cal.com <zomars@me.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
anikdhabal
added a commit
that referenced
this pull request
Jul 30, 2025
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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