Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

test(incremental): apply the ARM RSS budget by architecture, not page size

Martin Vogel073105283091
diff --git a/tests/test_incremental.c b/tests/test_incremental.c
index 83c9599f6..10d3c87cc 100644
--- a/tests/test_incremental.c
+++ b/tests/test_incremental.c
@@ -309,6 +309,18 @@ TEST(incr_full_index) {
if (sysconf(_SC_PAGESIZE) >= 16384) {
rss_limit_mb = 2816;
}
+#endif
+#if defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__)
+ /* ARM Linux uses 4KB pages, so the page-size bump above does NOT fire there,
+ * yet glibc's per-CPU malloc arenas + allocation rounding still inflate RSS
+ * to the documented ~2385MB for this index (the same inflation Apple silicon
+ * shows, which the page-size check catches via its 16KB pages). Apply the
+ * higher ARM budget on any ARM target so the guard still catches a real leak
+ * (GBs over) without false-failing on 4KB-page ARM Linux (e.g. CI's
+ * ubuntu-22.04-arm, which measured 2386MB against the un-bumped 2048 limit). */
+ if (rss_limit_mb < 2816) {
+ rss_limit_mb = 2816;
+ }
#endif
ASSERT_LT((int)rss_delta_mb, rss_limit_mb);