Files
easyai-ai-gateway/apps/api/internal/store/execution_pools_integration_test.go
T
wangbo 21f72da7a8 fix(routing): 修正 Worker 心跳时间查询
生产 shadow 发布证明 PostgreSQL 将未显式定型的时间参数推断为 interval,导致 Worker 列表和容量查询返回 SQLSTATE 42883。

改为在 Go 中计算心跳截止时间并以 timestamptz 参数查询,补充真实 PostgreSQL 集成回归。
2026-08-05 22:57:33 +08:00

21 lines
494 B
Go

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)
}
}