lmkd_test: remove memcg creation on non-AndroidGo devices

Memory cgroups are disabled on non-AndroidGo devices. Change the test
not to fail due to missing in-kernel memory cgroup support.

Bug: 172296409
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I35d724c23c22e97458976c1cad45fe9d993326f9
This commit is contained in:
Suren Baghdasaryan 2021-01-21 14:35:49 -08:00
parent dab3944256
commit d7146e0f54
1 changed files with 5 additions and 2 deletions

View File

@ -27,6 +27,7 @@
#include <android-base/properties.h>
#include <android-base/stringprintf.h>
#include <android-base/strings.h>
#include <cutils/properties.h>
#include <gtest/gtest.h>
#include <lmkd.h>
#include <liblmkd_utils.h>
@ -274,8 +275,10 @@ void runMemStressTest() {
<< data->oomadj;
data->allocated = 0;
data->finished = false;
if (property_get_bool("ro.config.low_ram", false)) {
ASSERT_FALSE(create_memcg(uid, pid) != 0)
<< "Child [pid=" << pid << "] failed to create a cgroup";
}
signal_state(ssync, STATE_CHILD_READY);
wait_for_state(ssync, STATE_PARENT_READY);
add_pressure(data);