fix(test): extend pi-agent E2E AgentTimeout to 60m for stage runs.

V0.1 workflow steps exceeded the default 30m pi-agent /v1/run deadline; align test config with production AGENT_TIMEOUT and runner env vars.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
weichen
2026-09-13 02:50:23 +00:00
committed by weichen
co-authored by Cursor
parent c6c7423ec6
commit f4619757e2
+20 -10
View File
@@ -25,20 +25,30 @@ import (
//
// 运行方式(需 pi-agent runner 在线,建议 1h 超时):
//
// go test ./internal/server/ -run TestPiAgent_FullLifecycle -timeout 1h -v
// go test ./internal/server/ -run TestPiAgent_FullLifecycle -timeout 2h -v
func TestPiAgent_FullLifecycle_MultiRole_RealWorld_E2E(t *testing.T) {
if testing.Short() {
t.Skip("skipping slow real-world E2E test in short mode")
}
// 1. 初始化配置并强制指定 pi-agent 后端与真实 Runner
runnerURL := os.Getenv("PI_AGENT_RUNNER_URL")
if runnerURL == "" {
runnerURL = "http://127.0.0.1:18865"
}
runnerToken := os.Getenv("PI_AGENT_RUNNER_AUTH_TOKEN")
if runnerToken == "" {
runnerToken = os.Getenv("RUNNER_AUTH_TOKEN")
}
cfg := &config.Config{
Env: "dev",
AgentBackend: "pi-agent",
PiAgentRunnerURL: "http://127.0.0.1:18865",
PiAgentModel: "MiniMax-M3",
PiAgentProvider: "minimax",
DataDir: t.TempDir(),
AllowInMemory: true,
Env: "dev",
AgentBackend: "pi-agent",
AgentTimeout: 60 * time.Minute,
PiAgentRunnerURL: runnerURL,
PiAgentRunnerAuthToken: runnerToken,
PiAgentModel: "MiniMax-M3",
PiAgentProvider: "minimax",
DataDir: t.TempDir(),
AllowInMemory: true,
}
svc := bizdev.MustNewService(t, cfg)
@@ -46,8 +56,8 @@ func TestPiAgent_FullLifecycle_MultiRole_RealWorld_E2E(t *testing.T) {
ts := httptest.NewServer(srv.Routes())
defer ts.Close()
// 单次 pi-agent 远程调用可能超过 10min;HTTP client 留 50min 余量,整体由 go test -timeout 1h 兜底。
client := &http.Client{Timeout: 50 * time.Minute}
// 单次 pi-agent 远程调用可能超过 30min;HTTP client 与 AgentTimeout 对齐,整体由 go test -timeout 2h 兜底。
client := &http.Client{Timeout: 65 * time.Minute}
ctx := context.Background()
stepStart := time.Now()
logStep := func(label string) {