Skip to content

test: concurrent-invite race test is flaky on the sqlite-file backend (admission_conflict) #855

Closed

Description

@antosubash

`modules/tenants/tests/test_owner_race.py::test_concurrent_invites_to_one_address_give_one[sqlite-file]` failed once in CI on PR #854, which does not touch tenants, and passed on re-run:

```
AssertionError: assert ['admission_c...nvited', 'ok'] == ['already_inv...nvited', 'ok']
```

Five concurrent invites to one address on a SQLite file DB: one loser came back with `admission_conflict` (`ERROR_ADMISSION_CONFLICT`, "someone else changed this organisation at the same moment") instead of `already_invited`. Both refuse the duplicate and only one invitation row exists, so the behaviour is safe; the test asserts the more specific code.

Options:

  • accept either refusal code in the test for the SQLite backend (the admission conflict is a legitimate outcome under write contention), or
  • have the invite path re-check for an existing pending invitation after an admission conflict and report `already_invited`.

CI run: https://github.com/antosubash/simple_module_python/actions/runs/42138496695

https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq

Activity

  1. added a commit that references this issue on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions