Test-suite: fix existing flakiness + cut runtime #533
Labels
No labels
bug
duplicate
enhancement
help wanted
high priority
invalid
L
low priority
M
medium priority
needs refinement
optional
question
S
technical improvement
UX Improvement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: local-it/mitgliederverwaltung#533
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
The suite is both slow (~206s; 164.6s of it synchronous) and already flaky (known: unrelated async
failures appear on re-run). Root cause is currently unknown, so this issue starts with diagnosis and then both
fixes the flakiness and reduces runtime.
Scope
--seed; capture whichtests fail and on which seeds; find the root cause. Usual Elixir suspects: async tests sharing global state
(Application env, named ETS/Agent, Gettext locale),
Process.sleep-based waits instead of event-basedassertions, PubSub/Task timing, DB-sandbox ownership, order-dependence.
event-based with
assert_receive/polling — no sleeps).async: true(the bulk of the 164.6s sync);remove the
Process.sleep(1000)import-wait (import_live_test.exs:40, itself a flakiness vector); drop thedead seeds guard (
seeds_test.exs:36). Anchors also:index_field_visibility_test.exs:13,161.create_fee_type/create_cyclefixtures (currently duplicated 18×/8×);replace
:sys.get_state(socket)internal-state assertions (index_test.exs:15-27,1014) with behaviorassertions.
Acceptance criteria
Process.sleep-based waits remain in the touched tests.just ci-devgreen.Caution
Flipping a genuinely shared-state test to
async: truecan introduce flakiness — convert only files withisolated data, per-file, and re-run repeatedly to confirm. Re-run before treating any newly-async failure as a
real regression.