mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-14 06:52:05 +00:00
test: cover provider allocation reconciliation SQL
This commit is contained in:
@@ -9,9 +9,11 @@ import (
|
|||||||
|
|
||||||
func TestAllocatorSQLClaimsAndAuditsCompatibleReadyServers(t *testing.T) {
|
func TestAllocatorSQLClaimsAndAuditsCompatibleReadyServers(t *testing.T) {
|
||||||
for query, fragments := range map[string][]string{
|
for query, fragments := range map[string][]string{
|
||||||
RegisterReadyServerSQL: {"game_servers", "ON CONFLICT", "state = 'READY'"},
|
RegisterReadyServerSQL: {"game_servers", "ON CONFLICT", "state = 'READY'"},
|
||||||
ClaimReadyServerSQL: {"state = 'READY'", "region = $1", "protocol_version = $3", "FOR UPDATE SKIP LOCKED", "ORDER BY server_id"},
|
ClaimReadyServerSQL: {"state = 'READY'", "region = $1", "protocol_version = $3", "FOR UPDATE SKIP LOCKED", "ORDER BY server_id"},
|
||||||
InsertAllocationSQL: {"allocations", "request_digest", "state", "ALLOCATED"},
|
InsertAllocationSQL: {"allocations", "request_digest", "state", "ALLOCATED"},
|
||||||
|
ProviderServerClaimSQL: {"state = 'READY'", "region = $2", "protocol_version = $4", "RETURNING"},
|
||||||
|
ServerAllocationConflictSQL: {"server_id = $1", "FOR UPDATE"},
|
||||||
} {
|
} {
|
||||||
for _, fragment := range fragments {
|
for _, fragment := range fragments {
|
||||||
if !contains(query, fragment) {
|
if !contains(query, fragment) {
|
||||||
|
|||||||
Reference in New Issue
Block a user