test(library): adapter 激活夹具绑定维护窗口时间
为什么:维护行由 attach 以 now() 建立,而 journal 的停写/排空观察早于它; 激活门正确拒绝"窗口在观察之后才开"。夹具把 acquired_at 校正到观察之前。
This commit is contained in:
@@ -593,7 +593,8 @@ func activateDS01(ctx context.Context, store *postgresstore.Store, pool *pgxpool
|
||||
journalSum := sha256.Sum256(rawJournal)
|
||||
if _, err := pool.Exec(ctx, `
|
||||
UPDATE library_instance_maintenance SET services=$2::jsonb, owner_scope='internal', level='instance',
|
||||
state='needs_restore', released_at=NULL, target_fingerprint=$3, updated_at=now()
|
||||
state='needs_restore', released_at=NULL, target_fingerprint=$3,
|
||||
acquired_at=LEAST(acquired_at, now()-interval '20 minutes'), updated_at=now()
|
||||
WHERE instance=$1`, ds01TargetInstance, `["worker-ds01"]`, fingerprint); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user