fix(routing): 修正 Worker 心跳时间查询
生产 shadow 发布证明 PostgreSQL 将未显式定型的时间参数推断为 interval,导致 Worker 列表和容量查询返回 SQLSTATE 42883。 改为在 Go 中计算心跳截止时间并以 timestamptz 参数查询,补充真实 PostgreSQL 集成回归。
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestExecutionPoolQueriesUseTimestampCutoff(t *testing.T) {
|
||||
db := billingV2IntegrationStore(t)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
if _, err := db.ListWorkers(ctx, time.Now()); err != nil {
|
||||
t.Fatalf("list workers with timestamp cutoff: %v", err)
|
||||
}
|
||||
if _, err := db.ListCapacity(ctx, time.Now()); err != nil {
|
||||
t.Fatalf("list capacity with timestamp cutoff: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user