Test Cases: Concurrency & Race Conditions

Module: Edge Cases - Concurrency

Priority: P2

Phase: 6 (Days 17-18)

Prerequisites


1. Event Registration Race Conditions

TC-CONC-01: Last Spot Race Condition

Scenario: Two users try to register for the last available spot simultaneously.

StepActionExpected Result
1Create or find an event with capacity = 1 remaining.Event has 1 spot left.
2Open Browser 1: Login as testmember@rcme.membervu.com.Dashboard displayed.
3Open Browser 2: Login as pending-payment@demo.membervu.com.Dashboard displayed.
4Browser 1: Navigate to event registration page."1 spot remaining" shown.
5Browser 2: Navigate to same event registration page."1 spot remaining" shown.
6Browser 1: Fill registration form, hover over submit.Ready to submit.
7Browser 2: Fill registration form, hover over submit.Ready to submit.
8Click submit in BOTH browsers as simultaneously as possible.One succeeds, one fails.
9Verify successful registration.Exactly ONE user registered.
10Verify failed registration.Error: "Event is full" or "No spots available".
11Verify database.Event registrations = capacity (no overbooking).

TC-CONC-02: Capacity Counter Accuracy

StepActionExpected Result
1Check event: e2e-free-event with capacity 50.Note current registrations.
2Open 5 browser tabs as different users.All logged in.
3Navigate all 5 to the event page.All show same "spots remaining".
4Submit registrations from all 5 rapidly.All 5 succeed (if capacity allows).
5Verify final capacity count.Accurate count, no race condition errors.

2. Payment Race Conditions

TC-CONC-03: Duplicate Payment Prevention

Scenario: Same user submits payment twice rapidly (double-click scenario).

StepActionExpected Result
1Login as testmember@rcme.membervu.com.Dashboard displayed.
2Navigate to a pending invoice.Invoice detail shown.
3Click "Pay Now", fill payment details.Form ready.
4Double-click submit button rapidly.Only ONE payment created.
5Verify in payments list.Single payment record.
6Verify UI feedback.Button disabled after first click, or loading state.

TC-CONC-04: Concurrent Payments for Same Invoice

Scenario: Two different users (or sessions) submit payment for same invoice.

StepActionExpected Result
1Login as user in Browser 1.-
2Login as admin/treasurer in Browser 2.-
3Browser 1: Open invoice, fill payment form.Ready to submit.
4Browser 2: Open same invoice, fill payment form.Ready to submit.
5Submit both simultaneously.Both may succeed (pending approval).
6Admin reviews payments.Can see both pending payments.
7Approve first payment (full amount).Invoice marked PAID.
8Attempt to approve second payment.Warning: "Invoice already paid" or handled as overpayment.

TC-CONC-05: Payment While Invoice Being Voided

StepActionExpected Result
1Browser 1: Login as member, open pending invoice.Invoice displayed.
2Browser 2: Login as treasurer, open same invoice.Invoice displayed.
3Browser 1: Fill payment form.Ready to submit.
4Browser 2: Click "Void Invoice", enter reason, confirm.Invoice voided.
5Browser 1: Submit payment.Error: "Invoice has been voided" or "Cannot pay voided invoice".

3. Data Edit Conflicts

TC-CONC-06: Simultaneous Profile Edit

Scenario: User edits profile from two browser tabs.

StepActionExpected Result
1Login as testmember@rcme.membervu.com in Tab 1.-
2Open same session in Tab 2 (copy URL).Same user, two tabs.
3Tab 1: Navigate to /profile, load current data.Profile form with current values.
4Tab 2: Navigate to /profile, load current data.Same current values.
5Tab 1: Change phone to "09171111111", save.Save successful.
6Tab 2: Change phone to "09172222222", save.Last save wins OR conflict warning.
7Refresh both tabs.Both show "09172222222" (last save).

TC-CONC-07: Simultaneous Member Edit (Admin)

StepActionExpected Result
1Admin 1: Open member edit page.Member data loaded.
2Admin 2: Open same member edit page.Same data loaded.
3Admin 1: Change status to SUSPENDED, save.Save successful.
4Admin 2: Change membership type, save.Either succeeds (last wins) or conflict warning.
5Verify final state.Both changes applied (if independent) or last change only.

TC-CONC-08: Event Edit During Registration

StepActionExpected Result
1Browser 1 (Admin): Open event edit page.Edit form displayed.
2Browser 2 (Member): Open same event for registration.Registration form displayed.
3Admin: Change event date, save.Save successful.
4Member: Submit registration with old date shown.Registration succeeds (uses current event data).
5Verify registration.Shows updated date.

4. Approval Workflow Conflicts

TC-CONC-09: Simultaneous Member Approval

Scenario: Two admins try to approve the same pending member.

StepActionExpected Result
1Browser 1: Login as admin@rcme.membervu.com.-
2Browser 2: Login as membershipchair@demo.membervu.com.-
3Both: Navigate to pending approvals list.Same pending member visible.
4Both: Click "Approve" on same member simultaneously.One succeeds, one gets error.
5Verify member status.ACTIVE (approved once).
6Verify approval record.Single approval, single invoice generated.

TC-CONC-10: Simultaneous Payment Approval

StepActionExpected Result
1Browser 1: Treasurer opens pending payments.Payment visible.
2Browser 2: Admin opens same pending payments.Same payment visible.
3Both click "Approve" on same payment.One succeeds, one gets "Already approved".
4Verify payment status.APPROVED (single approval).
5Verify invoice balance.Correctly updated once.

TC-CONC-11: Approve While Member Cancels

StepActionExpected Result
1Pending member has submitted application.Status: PENDING_APPROVAL.
2Browser 1 (Admin): Open approval queue, view application.Ready to approve.
3Browser 2 (Member): Cancel their application.Application withdrawn.
4Admin: Click Approve.Error: "Application no longer pending" or "Not found".

5. Session & Token Conflicts

TC-CONC-12: Concurrent Login Sessions

StepActionExpected Result
1Login as testmember@rcme.membervu.com in Browser 1.Session 1 active.
2Login as same user in Browser 2.Session 2 active.
3Perform action in Browser 1.Action succeeds.
4Perform action in Browser 2.Action succeeds (concurrent sessions allowed).
5Logout in Browser 1.Session 1 ended.
6Verify Browser 2 still works.Session 2 still active (or forced logout depending on policy).

TC-CONC-13: Password Change Invalidates Other Sessions

StepActionExpected Result
1Login in Browser 1 and Browser 2 as same user.Two active sessions.
2Browser 1: Change password in profile settings.Password changed.
3Browser 2: Attempt any action.Session invalidated OR still works (policy dependent).
4Browser 2: Refresh page.Redirect to login (if sessions invalidated).

6. Broadcast & Communications

TC-CONC-14: Edit Broadcast While Sending

StepActionExpected Result
1Create a broadcast to large segment (100+ recipients).Broadcast in DRAFT.
2Browser 1: Click "Send Now".Broadcast starts sending.
3Browser 2: Attempt to edit same broadcast.Edit blocked: "Broadcast is currently sending".
4Wait for send to complete.Status: SENT.
5Attempt to edit.Edit blocked: "Cannot edit sent broadcast".

TC-CONC-15: Delete Broadcast While Sending

StepActionExpected Result
1Create broadcast, start sending.Status: SENDING.
2Attempt to delete.Delete blocked or cancelled mid-send.
3Verify recipients.Either all received or none (atomic operation).

7. Inventory/Stock Scenarios

TC-CONC-16: Event Ticket Type Stock

Scenario: Event has limited "VIP" tickets.

StepActionExpected Result
1Event has 2 VIP tickets remaining, 50 regular.Displayed on event page.
2Browser 1: Select VIP ticket, proceed to checkout.VIP selected.
3Browser 2: Select VIP ticket, proceed to checkout.VIP selected.
4Browser 3: Select VIP ticket.Still shows 2 available (not reserved yet).
5Browser 1: Complete checkout.VIP tickets now 1 remaining.
6Browser 2: Complete checkout.VIP tickets now 0 remaining.
7Browser 3: Attempt complete checkout.Error: "VIP tickets sold out".

8. Database Integrity Tests

TC-CONC-17: Referential Integrity

StepActionExpected Result
1Create invoice for a member.Invoice references member.
2Attempt to delete member while invoice exists.Delete blocked or cascaded appropriately.
3Create event registration.Registration references member and event.
4Attempt to delete event with registrations.Blocked: "Event has registrations".

TC-CONC-18: Transaction Rollback

StepActionExpected Result
1Start complex operation (e.g., bulk invoice creation).-
2Simulate partial failure (network drop, etc.).-
3Verify database state.Either all records created or none (no partial state).

Test Execution Tips

Timing Techniques

  1. Two-person test: Have two testers coordinate actions via voice/chat
  2. Tab switching: Open action in multiple tabs, switch rapidly to click
  3. DevTools pause: Use debugger to pause before submit, then resume both
  4. Network throttling: Slow connection to extend race window

What to Verify


Summary Checklist

CategoryTest CasesPriority
Event RegistrationTC-CONC-01, TC-CONC-02P1
PaymentTC-CONC-03 to TC-CONC-05P0
Data EditingTC-CONC-06 to TC-CONC-08P2
Approval WorkflowTC-CONC-09 to TC-CONC-11P1
SessionsTC-CONC-12, TC-CONC-13P1
BroadcastsTC-CONC-14, TC-CONC-15P2
InventoryTC-CONC-16P1
DatabaseTC-CONC-17, TC-CONC-18P0