Fix staticcheck SA4000 in TestDurationHelpers
CI / test (push) Failing after 12m33s

Compare against expected values (300s, 20s, 5s) instead of self-comparison
This commit is contained in:
2026-07-30 18:14:51 -04:00
parent c2feb1bc75
commit fb5ae6ceb5
+11 -8
View File
@@ -3,6 +3,7 @@ package config
import (
"os"
"testing"
"time"
)
func TestLoad(t *testing.T) {
@@ -57,18 +58,20 @@ func TestLlamaServerURL(t *testing.T) {
}
func TestDurationHelpers(t *testing.T) {
t.Setenv("LLAMA_SERVER_STARTUP_TIMEOUT", "300")
t.Setenv("LLAMA_SERVER_STOP_TIMEOUT", "20")
t.Setenv("MODEL_SWAP_COOLDOWN", "5")
cfg := Load()
if cfg.LlamaServerStartupTimeoutDuration() != cfg.LlamaServerStartupTimeoutDuration() {
t.Error("startup timeout duration mismatch")
if got := cfg.LlamaServerStartupTimeoutDuration(); got != 300*time.Second {
t.Errorf("startup: got %v, want 300s", got)
}
if cfg.LlamaServerStopTimeoutDuration() != cfg.LlamaServerStopTimeoutDuration() {
t.Error("stop timeout duration mismatch")
if got := cfg.LlamaServerStopTimeoutDuration(); got != 20*time.Second {
t.Errorf("stop: got %v, want 20s", got)
}
if cfg.ModelSwapCooldownDuration() != cfg.ModelSwapCooldownDuration() {
t.Error("model swap cooldown duration mismatch")
if got := cfg.ModelSwapCooldownDuration(); got != 5*time.Second {
t.Errorf("cooldown: got %v, want 5s", got)
}
}