From 4350592133f3b52671d680f91203f1596183033c Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Mon, 22 May 2023 22:21:46 +0000 Subject: [PATCH] init_kill_services_test: special case apexd apexd restarts the device, so it causes flakes here, especially in presubmit. Bug: 280514080 Test: init_kill_services_test Change-Id: I4455704795961f3ae94e29bdf098eca739130973 --- init/test_kill_services/init_kill_services_test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init/test_kill_services/init_kill_services_test.cpp b/init/test_kill_services/init_kill_services_test.cpp index 227380d71..d9fcd9d45 100644 --- a/init/test_kill_services/init_kill_services_test.cpp +++ b/init/test_kill_services/init_kill_services_test.cpp @@ -23,8 +23,15 @@ using ::android::base::GetProperty; using ::android::base::SetProperty; +using ::android::base::WaitForProperty; +using std::literals::chrono_literals::operator""s; void ExpectKillingServiceRecovers(const std::string& service_name) { + // b/280514080 - servicemanager will restart apexd, and apexd will restart the + // system when crashed. This is fine as the device recovers, but it causes + // flakes in this test. + ASSERT_TRUE(WaitForProperty("init.svc.apexd", "stopped", 60s)) << "apexd won't stop"; + LOG(INFO) << "hello " << service_name << "!"; const std::string status_prop = "init.svc." + service_name; const std::string pid_prop = "init.svc_debug_pid." + service_name;