test(member-live): keep deadlock-prone member tests synchronous

These member/group/custom-field LiveView tests stay async: false. With the
foreign keys now deferrable the create_member deadlock no longer forces it, so
the rationale is updated: they remain synchronous as a deferred scope decision,
and index_groups_url_params/member_filter_component additionally have separate
async-isolation issues that must be fixed before they can run in parallel.
This commit is contained in:
Moritz 2026-06-16 17:53:59 +02:00
parent 5e84c342b7
commit c0f40a13ce
12 changed files with 48 additions and 13 deletions

View file

@ -8,7 +8,10 @@ defmodule MvWeb.Components.MemberFilterComponentTest do
- Button label and badge logic
- Filtering to show only boolean custom fields
"""
# async: false to prevent PostgreSQL deadlocks when running LiveView tests against DB
# Kept async: false. The deferrable-FK migration removed the concurrent
# create_member deadlock, but this file additionally showed an async-isolation
# failure under load (filtered members from a parallel test leaking in), so it
# is not trivially async-safe; resolving that is a separate follow-up.
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest

View file

@ -9,7 +9,10 @@ defmodule MvWeb.MemberLive.IndexCustomFieldsDisplayTest do
- Custom field values are correctly formatted for different types
- Members without custom field values show empty cell or "-"
"""
# async: false to prevent PostgreSQL deadlocks when creating members and custom fields
# Kept async: false as a deferred scope decision. The deferrable-FK migration
# removed the concurrent-create_member deadlock that previously forced this, so
# re-flipping this members/custom-fields suite to async is a possible follow-up
# rather than part of the original change.
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest
require Ash.Query

View file

@ -10,7 +10,10 @@ defmodule MvWeb.MemberLive.IndexFieldVisibilityTest do
- Integration with member list display
- Custom fields visibility
"""
# async: false to prevent PostgreSQL deadlocks when creating members and custom fields
# Kept async: false as a deferred scope decision. The deferrable-FK migration
# removed the concurrent-create_member deadlock that previously forced this, so
# re-flipping this members/custom-fields suite to async is a possible follow-up
# rather than part of the original change.
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest

View file

@ -8,7 +8,10 @@ defmodule MvWeb.MemberLive.IndexGroupsAccessibilityTest do
- Sort header has aria-label for screen reader
- Keyboard navigation works (Tab through filter, sort header)
"""
# async: false to prevent PostgreSQL deadlocks when creating members and groups
# Kept async: false as a deferred scope decision. The deferrable-FK migration
# removed the concurrent-create_member deadlock that previously forced this, so
# re-flipping this members/groups suite to async is a possible follow-up rather
# than part of the original change.
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest
require Ash.Query

View file

@ -8,7 +8,10 @@ defmodule MvWeb.MemberLive.IndexGroupsDisplayTest do
- No badge for members without groups
- Badge shows group name correctly
"""
# async: false to prevent PostgreSQL deadlocks when creating members and groups
# Kept async: false as a deferred scope decision. The deferrable-FK migration
# removed the concurrent-create_member deadlock that previously forced this, so
# re-flipping this members/groups suite to async is a possible follow-up rather
# than part of the original change.
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest
require Ash.Query

View file

@ -6,7 +6,10 @@ defmodule MvWeb.MemberLive.IndexGroupsFilterTest do
All / Yes / No (per group). Multiple active group filters combine with AND
(member must match all selected group conditions).
"""
# async: false to prevent PostgreSQL deadlocks when creating members and groups
# Kept async: false as a deferred scope decision. The deferrable-FK migration
# removed the concurrent-create_member deadlock that previously forced this, so
# re-flipping this members/groups suite to async is a possible follow-up rather
# than part of the original change.
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest
require Ash.Query

View file

@ -10,7 +10,10 @@ defmodule MvWeb.MemberLive.IndexGroupsIntegrationTest do
- Groups work with existing search (but not testing search integration itself)
- Member index search by group name returns members in that group (Issue #375)
"""
# async: false to prevent PostgreSQL deadlocks when creating members and groups
# Kept async: false as a deferred scope decision. The deferrable-FK migration
# removed the concurrent-create_member deadlock that previously forced this, so
# re-flipping this members/groups suite to async is a possible follow-up rather
# than part of the original change.
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest
require Ash.Query

View file

@ -8,7 +8,10 @@ defmodule MvWeb.MemberLive.IndexGroupsPerformanceTest do
- Filter works at database level (not in-memory)
- Sort runs in-memory but uses preloaded group data (no extra DB queries)
"""
# async: false to prevent PostgreSQL deadlocks when creating members and groups
# Kept async: false as a deferred scope decision. The deferrable-FK migration
# removed the concurrent-create_member deadlock that previously forced this, so
# re-flipping this members/groups suite to async is a possible follow-up rather
# than part of the original change.
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest
require Ash.Query

View file

@ -2,7 +2,10 @@ defmodule MvWeb.MemberLive.IndexGroupsSortingTest do
@moduledoc """
Tests for sorting by groups in the member overview.
"""
# async: false to prevent PostgreSQL deadlocks when creating members and groups
# Kept async: false as a deferred scope decision. The deferrable-FK migration
# removed the concurrent-create_member deadlock that previously forced this, so
# re-flipping this members/groups suite to async is a possible follow-up rather
# than part of the original change.
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest
require Ash.Query

View file

@ -9,7 +9,10 @@ defmodule MvWeb.MemberLive.IndexGroupsUrlParamsTest do
- URL parameters work with other parameters (query, sort_field, etc.)
- URL is bookmarkable (filter/sorting persist)
"""
# async: false to prevent PostgreSQL deadlocks when creating members and groups
# Kept async: false. The deferrable-FK migration removed the concurrent
# create_member deadlock, but this file additionally showed an async-isolation
# failure under load (filtered members from a parallel test leaking in), so it
# is not trivially async-safe; resolving that is a separate follow-up.
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest
require Ash.Query

View file

@ -10,8 +10,10 @@ defmodule MvWeb.MemberLive.ShowGroupsDisplayTest do
- Accessibility: group links have aria-label for screen readers
## Note on async
async: false to avoid PostgreSQL deadlocks when creating members and groups
in the same test run (same as IndexGroupsDisplayTest).
Kept async: false as a deferred scope decision. The deferrable-FK migration
removed the concurrent-create_member deadlock that previously forced this, so
re-flipping this members/groups suite to async is a possible follow-up rather
than part of the original change.
"""
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest

View file

@ -1,5 +1,8 @@
defmodule MvWeb.UserLive.FormTest do
# async: false to prevent PostgreSQL deadlocks when creating members and users
# Kept async: false as a deferred scope decision. The deferrable-FK migration
# removed the concurrent-create_member deadlock that previously forced this, so
# re-flipping this members/users suite to async is a possible follow-up rather
# than part of the original change.
use MvWeb.ConnCase, async: false
import Phoenix.LiveViewTest