fix(acceptance): 修复快照迁移重放与派发死锁
本地同构验收在全量迁移后导入生产快照,导致本次发布的数据迁移被旧能力覆盖;增加仅允许严格本地集群标记启用的导入后迁移重放,并新增幂等 Seedance 约束校准。\n\n批量异步派发改为在事务开始按全局顺序预锁全部任务与容量作用域,同时对 PostgreSQL 死锁和序列化失败做退避重试,避免双 API 重叠批次形成环形等待。\n\n验证:Go 全量测试、gofmt、bash -n、ShellCheck、迁移安全检查。
This commit is contained in:
@@ -32,6 +32,21 @@ CREATE INDEX CONCURRENTLY IF NOT EXISTS second_index ON second_table(id);
|
||||
}
|
||||
}
|
||||
|
||||
func TestAcceptanceImportReplayMarkerRequiresAnExactCommentLine(t *testing.T) {
|
||||
if !hasMigrationMarker(
|
||||
"-- preface\n"+acceptanceImportReplayMarker+"\nSELECT 1;\n",
|
||||
acceptanceImportReplayMarker,
|
||||
) {
|
||||
t.Fatal("expected exact acceptance import replay marker")
|
||||
}
|
||||
if hasMigrationMarker(
|
||||
"-- mentions "+acceptanceImportReplayMarker+" in prose\nSELECT 1;\n",
|
||||
acceptanceImportReplayMarker,
|
||||
) {
|
||||
t.Fatal("prose mention must not enable acceptance import replay")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSeedanceInputImageConstraintMigrationKeepsCatalogSnapshotsInSync(t *testing.T) {
|
||||
payload, err := os.ReadFile("../../migrations/0078_seedance_input_image_constraints.sql")
|
||||
if err != nil {
|
||||
@@ -74,6 +89,27 @@ func TestVolcesSeedanceInputImageConstraintMigrationUsesDocumentedBounds(t *test
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolcesSeedanceAcceptanceReconciliationIsReplayable(t *testing.T) {
|
||||
payload, err := os.ReadFile("../../migrations/0099_reconcile_volces_seedance20_acceptance_constraints.sql")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
content := string(payload)
|
||||
for _, required := range []string{
|
||||
acceptanceImportReplayMarker,
|
||||
"volces:doubao-seedance-2-0-260128",
|
||||
"volces:doubao-seedance-2-0-fast-260128",
|
||||
"volces:doubao-seedance-2-0-mini-260615",
|
||||
`"long_edge":300`,
|
||||
`"long_edge":6000`,
|
||||
`'[0.4,2.5]'::jsonb`,
|
||||
} {
|
||||
if !strings.Contains(content, required) {
|
||||
t.Fatalf("Volces acceptance reconciliation is missing %q", required)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSecurityEventSchemaMigrationsDefineCurrentLifecycle(t *testing.T) {
|
||||
streamPayload, err := os.ReadFile("../../migrations/0063_oidc_security_events.sql")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user