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

Function TestAutoMemoryLimit

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

Source from the content-addressed store, hash-verified

7)
8
9func TestAutoMemoryLimit(t *testing.T) {
10 // Reset cached value so test is independent
11 autoMemoryLimitOnce = sync.Once{}
12 autoMemoryLimitValue = ""
13
14 result := AutoMemoryLimit()
15 if result == "" {
16 t.Fatal("AutoMemoryLimit returned empty string")
17 }
18
19 // On Linux (CI and production), we should detect system memory
20 if runtime.GOOS == "linux" {
21 totalBytes := readSystemMemoryBytes()
22 if totalBytes == 0 {
23 t.Fatal("totalSystemMemoryBytes returned 0 on Linux")
24 }
25 t.Logf("Detected system memory: %d bytes, auto limit: %s", totalBytes, result)
26 }
27}
28
29func TestAutoMemoryLimitFormat(t *testing.T) {
30 // Reset cached value so test is independent

Callers

nothing calls this directly

Calls 2

AutoMemoryLimitFunction · 0.85
readSystemMemoryBytesFunction · 0.85

Tested by

no test coverage detected