Added a configurable timeout knob

This commit is contained in:
2026-05-04 22:38:20 -05:00
parent ea05945457
commit c5ce270090
15 changed files with 215 additions and 34 deletions

View File

@@ -64,6 +64,9 @@ func TestFilesystemRepository_GetProfile(t *testing.T) {
if p.Validation.ValidationMode != domain.ValidationBasic {
t.Fatalf("expected validation mode basic, got %q", p.Validation.ValidationMode)
}
if p.ModelDefaults.TimeoutSeconds != 120 {
t.Fatalf("expected timeout_seconds 120, got %d", p.ModelDefaults.TimeoutSeconds)
}
})
t.Run("invalid YAML", func(t *testing.T) {
@@ -94,6 +97,13 @@ func TestFilesystemRepository_GetProfile(t *testing.T) {
}
})
t.Run("negative timeout seconds", func(t *testing.T) {
_, err := repo.GetProfile(ctx, "negative-timeout", "")
if !errors.Is(err, ErrInvalidProfile) {
t.Errorf("expected ErrInvalidProfile for negative timeout_seconds, got %v", err)
}
})
t.Run("profile not found", func(t *testing.T) {
_, err := repo.GetProfile(ctx, "unknown", "")
if !errors.Is(err, ErrProfileNotFound) {