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

Function TestTotalSystemMemoryBytes

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

Source from the content-addressed store, hash-verified

58}
59
60func TestTotalSystemMemoryBytes(t *testing.T) {
61 if runtime.GOOS != "linux" {
62 t.Skip("Only runs on Linux")
63 }
64
65 total := readSystemMemoryBytes()
66 if total == 0 {
67 t.Fatal("Expected non-zero memory on Linux")
68 }
69
70 // Sanity check: at least 64MB (any reasonable system)
71 if total < 64*1024*1024 {
72 t.Fatalf("Suspiciously low memory: %d bytes", total)
73 }
74 t.Logf("System memory: %d bytes (%.1f GB)", total, float64(total)/(1024*1024*1024))
75}
76
77func TestParseMemoryBytes(t *testing.T) {
78 tests := []struct {

Callers

nothing calls this directly

Calls 1

readSystemMemoryBytesFunction · 0.85

Tested by

no test coverage detected