From 6b35366ef55bb5987c7ac91e1c100e9e55ef15cc Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Fri, 12 Jan 2018 16:09:51 -0800 Subject: [PATCH] Skip test_alignment_and_size if percpu_arena is enabled. test_alignment_and_size needs a lot of memory. When percpu_arena is enabled, multiple arenas may cause the test to OOM. --- test/integration/mallocx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/integration/mallocx.c b/test/integration/mallocx.c index b0b5cdac..35d72093 100644 --- a/test/integration/mallocx.c +++ b/test/integration/mallocx.c @@ -151,9 +151,17 @@ TEST_BEGIN(test_basic) { TEST_END TEST_BEGIN(test_alignment_and_size) { + const char *percpu_arena; + size_t sz = sizeof(percpu_arena); + + if(mallctl("opt.percpu_arena", &percpu_arena, &sz, NULL, 0) || + strcmp(percpu_arena, "disabled") != 0) { + test_skip("test_alignment_and_size skipped: " + "not working with percpu arena."); + }; #define MAXALIGN (((size_t)1) << 23) #define NITER 4 - size_t nsz, rsz, sz, alignment, total; + size_t nsz, rsz, alignment, total; unsigned i; void *ps[NITER];