(_ context.Context, query string, _ ...any)
| 67 | "DefaultControlPlaneIdleTimeout = %v: too long to hold a pinned worker by default", |
| 68 | DefaultControlPlaneIdleTimeout, |
| 69 | ) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | func TestNormalizeIdleTimeout(t *testing.T) { |
| 74 | const def = 60 * time.Second |
| 75 | cases := []struct { |
| 76 | name string |
| 77 | configured time.Duration |
| 78 | want time.Duration |
| 79 | }{ |
| 80 | {"unset uses default", 0, def}, |
| 81 | {"negative disables", -1, 0}, |
| 82 | {"explicit positive passes through", 90 * time.Second, 90 * time.Second}, |
| 83 | {"any negative disables", -5 * time.Minute, 0}, |
| 84 | } |
| 85 | for _, tc := range cases { |
| 86 | if got := NormalizeIdleTimeout(tc.configured, def); got != tc.want { |
| 87 | t.Errorf("%s: NormalizeIdleTimeout(%v, %v) = %v, want %v", tc.name, tc.configured, def, got, tc.want) |
| 88 | } |
| 89 | } |
nothing calls this directly
no outgoing calls
no test coverage detected