mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-13 08:12:03 +00:00
feat: atomically create matchmaking proposals
This commit is contained in:
@@ -19,7 +19,7 @@ func TestRetryableRecognisesPostgresSerializationAndDeadlockErrors(t *testing.T)
|
||||
}
|
||||
|
||||
func TestClaimSQLContainsDurableOwnershipFences(t *testing.T) {
|
||||
for _, fragment := range []string{"FOR UPDATE SKIP LOCKED", "state = 'QUEUED'", "proposal_participants", "revision = revision + 1"} {
|
||||
for _, fragment := range []string{"FOR UPDATE SKIP LOCKED", "state = 'QUEUED'", "proposal_participants", "revision = revision + 1", "INSERT INTO proposals"} {
|
||||
if !containsAnySQL(fragment) {
|
||||
t.Fatalf("claim boundary missing %q", fragment)
|
||||
}
|
||||
@@ -27,7 +27,7 @@ func TestClaimSQLContainsDurableOwnershipFences(t *testing.T) {
|
||||
}
|
||||
|
||||
func containsAnySQL(fragment string) bool {
|
||||
return index(CandidateClaimSQL, fragment) >= 0 || index(ProposalParticipantInsertSQL, fragment) >= 0 || index(QueueTicketProposeSQL, fragment) >= 0
|
||||
return index(CandidateClaimSQL, fragment) >= 0 || index(ProposalParticipantInsertSQL, fragment) >= 0 || index(QueueTicketProposeSQL, fragment) >= 0 || index(ProposalInsertSQL, fragment) >= 0
|
||||
}
|
||||
|
||||
func index(s, fragment string) int {
|
||||
|
||||
Reference in New Issue
Block a user