Remove the known causes of random red test runs closes #695 #700

Merged
simon merged 14 commits from issue/mitgliederverwaltung-695 into main 2026-11-20 09:01:17 +01:00
Owner

closes #695

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

Tests: the suite no longer fails at random on a loaded machine for the five known reasons (lost sandbox connection, foreign compile warnings, short waits on background tasks and LiveView patches, whole-table counts).

What has been changed?

  • Keep a test's database connection for its whole timeout
  • Read compile warnings only from the own compilation
  • Give LiveView patches and messages 1 s by default
  • Wait for background tasks with one shared timeout
  • Count only the join requests a test created
  • Run the index bulk scope tests async again
  • Run the index filter chips tests async again
  • Run the index filter input hardening tests async again
  • Run the index value control tests async again
  • Catch every spelling of standard-error capture in async modules
  • Reject message waits shorter than the suite default
  • Wait for every background task with the shared timeout
  • Run the end-to-end join flow async with a process-local settings override
  • Name the five patterns behind random red test runs

Definition of Done

Code Quality

  • No new technical depths
  • Linting passed
  • Documentation is added were needed

Accessibility

  • New elements are properly defined with html-tags
  • Colour contrast follows WCAG criteria
  • Aria labels are added when needed
  • Everything is accessible by keyboard
  • Tab-Order is comprehensible
  • All interactive elements have a visible focus

Testing

  • Tests for new code are written
  • All tests pass
  • axe-core dev tools show no critical or major issues

Additional Notes

  • Test-only change: no product code, no migration, nothing visible; therefore no CHANGELOG entry.
  • Behaviour a reviewer may not expect:
    • ExUnit.start(assert_receive_timeout: 1_000) raises the default wait of every assert_receive, assert_patch and assert_reply from 100 ms to 1 s. A passing test is not slower; a failing one reports up to 1 s later. A member-index patch takes two hops (component send(self()) → handle_info → push_patch → handle_params loads the page), which 100 ms did not always cover.
    • The new test/mv/repo/sandbox_ownership_test.exs is tagged :slow and sleeps 121 s to prove a test keeps its connection past the 120 s sandbox default. It runs in test-all and in Drone's plain mix test (async, so it overlaps the other async tests).
    • Five modules run async again: four member-index files that were serial because assert_patch/1 missed the patch, and the end-to-end join flow, which now sets the join form through the process-local settings override instead of writing the settings row.
  • Mv.Architecture.TestSuiteConventionsTest gets three rules: no standard-error capture in an async module, the default message wait stays at least 1 s, and no literal wait below 1 s.
  • Larger commits: "Read compile warnings only from the own compilation" (6 files, moves the compile-time warning tests of button, badge and callout into one serial module), "Give LiveView patches and messages 1 s by default" (8 files, removes six local @patch_timeout), "Wait for every background task with the shared timeout" (6 files).
  • Proof: 10× just ci-dev in a row with 0 test failures while a second full suite ran in parallel, and 3× just test-all.
closes #695 ## Description of the implemented changes The changes were: - [x] Bugfixing - [ ] New Feature - [ ] Breaking Change - [x] Refactoring Tests: the suite no longer fails at random on a loaded machine for the five known reasons (lost sandbox connection, foreign compile warnings, short waits on background tasks and LiveView patches, whole-table counts). ## What has been changed? - Keep a test's database connection for its whole timeout - Read compile warnings only from the own compilation - Give LiveView patches and messages 1 s by default - Wait for background tasks with one shared timeout - Count only the join requests a test created - Run the index bulk scope tests async again - Run the index filter chips tests async again - Run the index filter input hardening tests async again - Run the index value control tests async again - Catch every spelling of standard-error capture in async modules - Reject message waits shorter than the suite default - Wait for every background task with the shared timeout - Run the end-to-end join flow async with a process-local settings override - Name the five patterns behind random red test runs ## Definition of Done ### Code Quality - [ ] No new technical depths - [x] Linting passed - [x] Documentation is added were needed ### Accessibility - [ ] New elements are properly defined with html-tags - [ ] Colour contrast follows WCAG criteria - [ ] Aria labels are added when needed - [ ] Everything is accessible by keyboard - [ ] Tab-Order is comprehensible - [ ] All interactive elements have a visible focus ### Testing - [x] Tests for new code are written - [x] All tests pass - [ ] axe-core dev tools show no critical or major issues ## Additional Notes - Test-only change: no product code, no migration, nothing visible; therefore no CHANGELOG entry. - Behaviour a reviewer may not expect: - `ExUnit.start(assert_receive_timeout: 1_000)` raises the default wait of every `assert_receive`, `assert_patch` and `assert_reply` from 100 ms to 1 s. A passing test is not slower; a failing one reports up to 1 s later. A member-index patch takes two hops (component `send(self())` → `handle_info` → `push_patch` → `handle_params` loads the page), which 100 ms did not always cover. - The new `test/mv/repo/sandbox_ownership_test.exs` is tagged `:slow` and sleeps 121 s to prove a test keeps its connection past the 120 s sandbox default. It runs in `test-all` and in Drone's plain `mix test` (async, so it overlaps the other async tests). - Five modules run async again: four member-index files that were serial because `assert_patch/1` missed the patch, and the end-to-end join flow, which now sets the join form through the process-local settings override instead of writing the settings row. - `Mv.Architecture.TestSuiteConventionsTest` gets three rules: no standard-error capture in an async module, the default message wait stays at least 1 s, and no literal wait below 1 s. - Larger commits: "Read compile warnings only from the own compilation" (6 files, moves the compile-time warning tests of button, badge and callout into one serial module), "Give LiveView patches and messages 1 s by default" (8 files, removes six local `@patch_timeout`), "Wait for every background task with the shared timeout" (6 files). - Proof: 10× `just ci-dev` in a row with 0 test failures while a second full suite ran in parallel, and 3× `just test-all`.
simon merged commit ff6ea5fad0 into main 2026-11-20 09:01:17 +01:00
simon deleted branch issue/mitgliederverwaltung-695 2026-11-20 09:01:19 +01:00
Sign in to join this conversation.
No description provided.