Repository navigation
test(api): collaborative creates in the same second no longer collide on slug - #397
Draft
saqibmanan wants to merge 1 commit into
Draft
saqibmanan wants to merge 1 commit into
saqibmanan wants to merge 1 commit into
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Covers DataSpaceBackend#323 (merge
e6a9042... base; merge commit1350de4): 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: addstest_simultaneous_add_collaborative_calls_all_succeed, following the file's existing barrier pattern for the dataset/upload races it already covers. SixaddCollaborativecalls released at the same instant get the identical default title, forcing the validation-level slug collision the fix retries. Markersapi+functional(same as the rest of the file; needs real backend writes, not a pure read check).Checked:
1 passedeach (collected under CI'ssmoke or functionalfilter)assert len(set(slugs)) == PARALLELreadonlyand isn't gated — matches the rest oftest_api_func_009)Gaps: none.