Skip to content

test(api): collaborative creates in the same second no longer collide on slug - #397

Draft
saqibmanan wants to merge 1 commit into
CIfrom
test-sync/DataSpaceBackend-pr323
Draft

saqibmanan wants to merge 1 commit into
CIfrom
test-sync/DataSpaceBackend-pr323

Conversation

@saqibmanan

@saqibmanan saqibmanan commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Covers DataSpaceBackend#323 (merge e6a9042... base; merge commit 1350de4): default-titled collaboratives created in the same second used to collide on slug, and only the database-level collision was retried with a suffix — one caught by validation before the save failed the whole create.

  • tests/api/functional/test_api_func_009_concurrent_creates.py: adds test_simultaneous_add_collaborative_calls_all_succeed, following the file's existing barrier pattern for the dataset/upload races it already covers. Six addCollaborative calls released at the same instant get the identical default title, forcing the validation-level slug collision the fix retries. Markers api+functional (same as the rest of the file; needs real backend writes, not a pure read check).

Checked:

  • dev: 2 runs, 1 passed each (collected under CI's smoke or functional filter)
  • red: reconstructed the pre-fix shape (two of six results sharing one slug, as if the retry hadn't fired) and ran the same assertion against it — fails at assert len(set(slugs)) == PARALLEL
  • prod: not run (write mutation; this file is not readonly and isn't gated — matches the rest of test_api_func_009)

Gaps: none.

… on slug

DataSpaceBackend#323: addCollaborative gives every default-titled draft the
identical title ("New collaborative <date>-<time>", to the second), and the
slug comes from it. Only the database-level collision was retried with a
suffix; one caught by validation before the save failed the whole create.

Releases six addCollaborative calls at the same instant (the same barrier
pattern already used for the dataset/upload races in this file) so they hit
that validation-level collision directly, and asserts all six succeed with
distinct slugs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant