MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestAutoMemoryLimitFormat

Function TestAutoMemoryLimitFormat

server/sysinfo/sysinfo_test.go:29–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27}
28
29func TestAutoMemoryLimitFormat(t *testing.T) {
30 // Reset cached value so test is independent
31 autoMemoryLimitOnce = sync.Once{}
32 autoMemoryLimitValue = ""
33
34 result := AutoMemoryLimit()
35 // Should end with GB or MB
36 validSuffix := false
37 for _, suffix := range []string{"GB", "MB"} {
38 if len(result) > len(suffix) && result[len(result)-len(suffix):] == suffix {
39 validSuffix = true
40 break
41 }
42 }
43 if !validSuffix {
44 t.Fatalf("AutoMemoryLimit returned %q, expected suffix GB or MB", result)
45 }
46}
47
48func TestAutoMemoryLimitCached(t *testing.T) {
49 // Reset and call twice — should return same value

Callers

nothing calls this directly

Calls 1

AutoMemoryLimitFunction · 0.85

Tested by

no test coverage detected