API Testing error

Error: Request failed with status code 409 (Conflict)

The API refused to create/update a resource because it already exists in that state, a common symptom of tests sharing data instead of isolating it.

Why this happens

How to fix it

  1. Generate unique identifiers per test run (timestamp/UUID suffix) instead of hardcoded fixture values
  2. Add teardown that deletes what the test created, even on failure, so a crashed run doesn't poison the next one
  3. Avoid running tests that mutate shared unique resources in parallel against the same environment