fix: resolve flaky no-show-updated-action integration test#27772
Merged
hariombalhara merged 1 commit intomainfrom Feb 9, 2026
Merged
fix: resolve flaky no-show-updated-action integration test#27772hariombalhara merged 1 commit intomainfrom
hariombalhara merged 1 commit intomainfrom
Conversation
- Remove unused attendeeIds field and unnecessary prisma.booking.findUnique from beforeEach - Store booking.id in testData to avoid re-querying booking in test body - Track additional attendee emails via additionalAttendeeEmails array for proper afterEach cleanup - Remove fragile prisma.attendee.delete (throws P2025 on missing record) from test body - Use deleteMany-based cleanupTestData for second attendee cleanup instead The test was flaky because: 1. It used prisma.attendee.delete (singular) which throws if record is already gone 2. It re-queried the booking via findUnique mid-test which could fail if cascade-deleted 3. The second attendee email was not tracked in afterEach cleanup Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
alishaz-polymath
approved these changes
Feb 9, 2026
Contributor
E2E results are ready! |
3 tasks
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.
What does this PR do?
Fixes the flaky
no-show-updated-action.integration-test.tsthat was failing intermittently across unrelated PRs (#27546, #26792, #27664) due to fragile inline Prisma operations and improper cleanup of dynamically created test data.Root cause
This was the only booking-audit integration test that performed raw Prisma queries inside the test body. When integration tests run in parallel against a shared Postgres database, cascade deletes from other test files' cleanup (
User → Booking → Attendee) could remove this test's data mid-execution, causing:PrismaClientKnownRequestError (P2025)—prisma.attendee.deleteon an already-gone recordBookingAuditPermissionError: BOOKING_NOT_FOUND—prisma.booking.findUniquereturning null after cascadeChanges
prisma.booking.findUniquefrombeforeEach— it populatedattendeeIdswhich was never read by any testbooking.idintestData— eliminates the need to re-query the booking mid-test to get its IDprisma.attendee.delete(throws on missing) with properafterEachcleanup viacleanupTestData(usesdeleteMany, no-throw)additionalAttendeeEmailstracking — second attendee created in "multiple attendees" test is now properly cleaned up via the sharedafterEach, following the same pattern asaccepted-action.integration-test.tsHow should this be tested?
Run all integration tests multiple times to verify the no-show test no longer flakes:
TZ=UTC VITEST_MODE=integration yarn testLocally verified with 4 consecutive runs — the no-show test passed all 4 times. (Other pre-existing flaky tests like
managedEventManualReassignmentstill fail intermittently, unrelated to this change.)Mandatory Tasks (DO NOT REMOVE)
Review checklist for humans
attendeeIdswas truly unused — it was populated but never referenced in any assertionbooking.idis available fromcreateTestBookingreturn value (it callsprisma.booking.createwhich returns all scalar fields)