Commit d80493f
fix: resolve flaky API v2 slots-2024-04-15 E2E tests (calcom#28589)
- Add await to unawaited bookingSeatsRepositoryFixture.create calls
- Clean up leftover selected slots before seated event tests
The flakiness was caused by two issues:
1. Missing await on bookingSeatsRepositoryFixture.create() - the HTTP
request to fetch slots could execute before the booking seat record
was written to the database, leading to incorrect seat counts.
2. Leftover SelectedSlots records leaking between test groups - the
availability calculation fetches all unexpired reserved slots by
userId (not eventTypeId), so reserved slots from earlier tests
appeared as busy times when computing slots for seated event types.
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>1 parent d685278 commit d80493f
File tree
1 file changed
+6
-2
lines changed- apps/api/v2/src/modules/slots/slots-2024-04-15/controllers
1 file changed
+6
-2
lines changedLines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
| 516 | + | |
| 517 | + | |
516 | 518 | | |
517 | 519 | | |
518 | 520 | | |
| |||
548 | 550 | | |
549 | 551 | | |
550 | 552 | | |
551 | | - | |
| 553 | + | |
552 | 554 | | |
553 | 555 | | |
554 | 556 | | |
| |||
596 | 598 | | |
597 | 599 | | |
598 | 600 | | |
| 601 | + | |
| 602 | + | |
599 | 603 | | |
600 | 604 | | |
601 | 605 | | |
| |||
631 | 635 | | |
632 | 636 | | |
633 | 637 | | |
634 | | - | |
| 638 | + | |
635 | 639 | | |
636 | 640 | | |
637 | 641 | | |
| |||
0 commit comments