Skip to content

fix: use randomString() for booking uid in slots e2e tests to avoid unique constraint flake#27916

Merged
alishaz-polymath merged 3 commits intomainfrom
devin/1770938134-fix-flaky-slots-test-uid
Feb 13, 2026
Merged

fix: use randomString() for booking uid in slots e2e tests to avoid unique constraint flake#27916
alishaz-polymath merged 3 commits intomainfrom
devin/1770938134-fix-flaky-slots-test-uid

Conversation

@alishaz-polymath
Copy link
Copy Markdown
Member

What does this PR do?

Fixes a flaky test caused by hardcoded booking UIDs in seated event slot e2e tests. The tests used booking-uid-${seatedEventTypeId} as the UID, which is deterministic and causes Unique constraint failed on the fields: (uid) errors when prior test data isn't fully cleaned up.

Replaces the deterministic ID with randomString() (already imported and used elsewhere in both files) to guarantee uniqueness across runs.

Affected tests:

  • slots-2024-04-15/controllers/slots.controller.e2e-spec.ts — 2 occurrences
  • slots-2024-09-04/controllers/e2e/user-event-type-slots.controller.e2e-spec.ts — 2 occurrences

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Run the affected e2e test suites multiple times in succession — the seated event booking tests should no longer fail with unique constraint errors:

yarn test -- src/modules/slots/slots-2024-04-15/controllers/slots.controller.e2e-spec.ts
yarn test -- src/modules/slots/slots-2024-09-04/controllers/e2e/user-event-type-slots.controller.e2e-spec.ts

Human Review Checklist

  • Verify randomString() is already imported in both test files (no new dependencies)
  • Verify downstream assertions using booking.uid (e.g., bookingUid: booking.uid) still work since they read the value back from the created object

Link to Devin run: https://app.devin.ai/sessions/2741867580d6485c94097e64d3b3b175
Requested by: @alishaz-polymath

…nique constraint flake

Co-Authored-By: ali@cal.com <alishahbaz7@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@alishaz-polymath alishaz-polymath marked this pull request as ready for review February 12, 2026 23:20
@alishaz-polymath alishaz-polymath requested a review from a team as a code owner February 12, 2026 23:20
@graphite-app graphite-app bot requested a review from a team February 12, 2026 23:20
@graphite-app graphite-app bot added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Feb 12, 2026
@alishaz-polymath alishaz-polymath added the run-ci Approve CI to run for external contributors label Feb 12, 2026
@alishaz-polymath alishaz-polymath enabled auto-merge (squash) February 12, 2026 23:21
@github-actions
Copy link
Copy Markdown
Contributor

E2E results are ready!

@alishaz-polymath alishaz-polymath merged commit bdeb4b1 into main Feb 13, 2026
51 checks passed
@alishaz-polymath alishaz-polymath deleted the devin/1770938134-fix-flaky-slots-test-uid branch February 13, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO ready-for-e2e run-ci Approve CI to run for external contributors size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants