Commit 7bffeb9a authored by Erik Chen's avatar Erik Chen Committed by Commit Bot

Loosen restriction on profiled renderers for memlog e2e tests.

Previously, we checked that at least 1 renderer exists and that all
renderers are being profiled. This recently started causing the tests to
flake. I suspect this is related to warm-up/spare renderers. So instead,
we check that at least 1 renderer exists and is being profiled.

Bug: 835826, 833590
Change-Id: I45ef8e1ad9ba1689ae3f0292ab80306b9d7a731f
Reviewed-on: https://chromium-review.googlesource.com/1023716Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553164}
parent d481772f
...@@ -61,25 +61,28 @@ constexpr int kPartitionAllocSize = 8 * 23; ...@@ -61,25 +61,28 @@ constexpr int kPartitionAllocSize = 8 * 23;
constexpr int kPartitionAllocCount = 107; constexpr int kPartitionAllocCount = 107;
static const char* kPartitionAllocTypeName = "kPartitionAllocTypeName"; static const char* kPartitionAllocTypeName = "kPartitionAllocTypeName";
// Whether at least 1 renderer exists, and all renderers are being profiled. // Ideally, we'd check to see that at least one renderer exists, and all
// renderers are being profiled, but something odd seems to be happening with
// warm-up/spare renderers.
//
// Whether at least 1 renderer exists, and at least 1 renderer is being
// profiled.
bool RenderersAreBeingProfiled( bool RenderersAreBeingProfiled(
const std::vector<base::ProcessId>& profiled_pids) { const std::vector<base::ProcessId>& profiled_pids) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
size_t renderer_count = 0;
for (auto iter = content::RenderProcessHost::AllHostsIterator(); for (auto iter = content::RenderProcessHost::AllHostsIterator();
!iter.IsAtEnd(); iter.Advance()) { !iter.IsAtEnd(); iter.Advance()) {
if (iter.GetCurrentValue()->GetProcess().Handle() == if (iter.GetCurrentValue()->GetProcess().Handle() ==
base::kNullProcessHandle) base::kNullProcessHandle)
continue; continue;
base::ProcessId pid = iter.GetCurrentValue()->GetProcess().Pid(); base::ProcessId pid = iter.GetCurrentValue()->GetProcess().Pid();
if (std::find(profiled_pids.begin(), profiled_pids.end(), pid) == if (std::find(profiled_pids.begin(), profiled_pids.end(), pid) !=
profiled_pids.end()) { profiled_pids.end()) {
return false; return true;
} }
++renderer_count;
} }
return renderer_count != 0; return false;
} }
// On success, populates |pid|. // On success, populates |pid|.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment