From f4e5c73eb298ca0dfd5bbccb7474b8350faaa8bd Mon Sep 17 00:00:00 2001 From: ddCat <2695092045@qq.com> Date: Tue, 22 Sep 2026 11:59:14 +0800 Subject: [PATCH] =?UTF-8?q?test(agent):=20=E6=89=A7=E8=A1=8C=E8=BE=B9?= =?UTF-8?q?=E7=95=8C=20-=20=E8=A6=86=E7=9B=96=E7=8E=AF=E5=A2=83=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E8=8C=83=E5=9B=B4=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../runtime_policy_agent_limits_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 backend/internal/platform/runtime_policy_agent_limits_test.go diff --git a/backend/internal/platform/runtime_policy_agent_limits_test.go b/backend/internal/platform/runtime_policy_agent_limits_test.go new file mode 100644 index 000000000..32f5c604b --- /dev/null +++ b/backend/internal/platform/runtime_policy_agent_limits_test.go @@ -0,0 +1,19 @@ +package platform + +import "testing" + +func TestAgentStepTimeoutEnvironmentBounds(t *testing.T) { + for _, tc := range []struct { + value string + want int + }{ + {"-1", 0}, {"0", 0}, {"1", 30}, {"29", 30}, {"30", 30}, {"90", 90}, {"3601", 3600}, + } { + t.Run(tc.value, func(t *testing.T) { + t.Setenv("CANVAS_AGENT_STEP_TIMEOUT_SECONDS", tc.value) + if got := agentStepTimeoutSecondsDefault(); got != tc.want { + t.Fatalf("timeout = %d, want %d", got, tc.want) + } + }) + } +}