CBL-Mariner/SPECS/prometheus-process-exporter/01-fix-RSS-test-on-non4K-pa...

21 строка
697 B
Diff

Description: Fix TestReadFixture on non 4K page size arches
TestReadFixture checks fixtures/14804/stat RSS which is a number of page
and compares it to hardcoded expected value 0x7b1000 (= 1969 * 4096).
Instead of using a 4k expected value, use system's pagesize like it's
done in proc_stat.go .
Author: Frédéric Bonnard <frediz@debian.org>
Forwarded: no
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/proc/read_test.go
+++ b/proc/read_test.go
@@ -83,7 +83,7 @@
CtxSwitchNonvoluntary: 6,
},
Memory: Memory{
- ResidentBytes: 0x7b1000,
+ ResidentBytes: uint64(0x7b1 * os.Getpagesize()),
VirtualBytes: 0x1061000,
VmSwapBytes: 0x2800,
},