Skip to content

fix: resolve flaky no-show-updated-action integration test#27772

Merged
hariombalhara merged 1 commit intomainfrom
devin/1770612156-fix-flaky-no-show-integration-test
Feb 9, 2026
Merged

fix: resolve flaky no-show-updated-action integration test#27772
hariombalhara merged 1 commit intomainfrom
devin/1770612156-fix-flaky-no-show-integration-test

Conversation

@hariombalhara
Copy link
Copy Markdown
Member

@hariombalhara hariombalhara commented Feb 9, 2026

What does this PR do?

Fixes the flaky no-show-updated-action.integration-test.ts that 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.delete on an already-gone record
  • BookingAuditPermissionError: BOOKING_NOT_FOUNDprisma.booking.findUnique returning null after cascade

Changes

  1. Removed unnecessary prisma.booking.findUnique from beforeEach — it populated attendeeIds which was never read by any test
  2. Stored booking.id in testData — eliminates the need to re-query the booking mid-test to get its ID
  3. Replaced fragile prisma.attendee.delete (throws on missing) with proper afterEach cleanup via cleanupTestData (uses deleteMany, no-throw)
  4. Added additionalAttendeeEmails tracking — second attendee created in "multiple attendees" test is now properly cleaned up via the shared afterEach, following the same pattern as accepted-action.integration-test.ts

How 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 test

Locally verified with 4 consecutive runs — the no-show test passed all 4 times. (Other pre-existing flaky tests like managedEventManualReassignment still fail intermittently, unrelated to this change.)

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 — test-only change.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

Review checklist for humans

  • Verify that attendeeIds was truly unused — it was populated but never referenced in any assertion
  • Confirm booking.id is available from createTestBooking return value (it calls prisma.booking.create which returns all scalar fields)
  • Note: import reordering and single-line array formatting are auto-applied by biome — no logic changes

Link to Devin run: https://app.devin.ai/sessions/1effb12fa2904b36a152dc3560f16eaf
Requested by: @hariombalhara


Open with Devin

- 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>
@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

@hariombalhara hariombalhara marked this pull request as ready for review February 9, 2026 04:52
@graphite-app graphite-app bot added the core area: core, team members only label Feb 9, 2026
@graphite-app graphite-app bot requested a review from a team February 9, 2026 04:52
@graphite-app graphite-app bot added the enterprise area: enterprise, audit log, organisation, SAML, SSO label Feb 9, 2026
@hariombalhara hariombalhara added ready-for-e2e and removed enterprise area: enterprise, audit log, organisation, SAML, SSO core area: core, team members only labels Feb 9, 2026
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 1 file

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@hariombalhara hariombalhara enabled auto-merge (squash) February 9, 2026 04:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

E2E results are ready!

@hariombalhara hariombalhara merged commit 0ec07b0 into main Feb 9, 2026
131 of 135 checks passed
@hariombalhara hariombalhara deleted the devin/1770612156-fix-flaky-no-show-integration-test branch February 9, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants