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 ( import (
"os" "os"
"testing" "testing"
"time"
) )
func TestLoad(t *testing.T) { func TestLoad(t *testing.T) {
@@ -57,18 +58,20 @@ func TestLlamaServerURL(t *testing.T) {
} }
func TestDurationHelpers(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() cfg := Load()
if cfg.LlamaServerStartupTimeoutDuration() != cfg.LlamaServerStartupTimeoutDuration() { if got := cfg.LlamaServerStartupTimeoutDuration(); got != 300*time.Second {
t.Error("startup timeout duration mismatch") t.Errorf("startup: got %v, want 300s", got)
} }
if got := cfg.LlamaServerStopTimeoutDuration(); got != 20*time.Second {
if cfg.LlamaServerStopTimeoutDuration() != cfg.LlamaServerStopTimeoutDuration() { t.Errorf("stop: got %v, want 20s", got)
t.Error("stop timeout duration mismatch")
} }
if got := cfg.ModelSwapCooldownDuration(); got != 5*time.Second {
if cfg.ModelSwapCooldownDuration() != cfg.ModelSwapCooldownDuration() { t.Errorf("cooldown: got %v, want 5s", got)
t.Error("model swap cooldown duration mismatch")
} }
} }