Skip to content

Tests: add concurrent PATCH race test #22

Description

@koinsaari

handlePatchAccessibility does a transactional read-then-upsert (cmd/api/main.go:208-239). There is no test verifying behavior under concurrent writes — two simultaneous PATCHes against the same place could in theory both take the create branch.

Suggested test

  • Create a place with no accessibility profile.
  • Fire N concurrent PATCH requests against /places/{id}/accessibility with different OverallStatus values.
  • Assert: exactly one row exists in accessibility_profiles for that place; the final stored value matches one of the inputs; no errors return 500.
  • Run with -race to catch any data races on shared state in the handler/server.
  • File: extend cmd/api/integration_test.go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions