Commit c994757c authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

mac: disable some more stack sampler tests on macOS 11

Bug: 1101399
Change-Id: I4d4b5201209371a20beb656137de2c3aff09ed94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346997Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796801}
parent 5d0804e2
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "base/profiler/stack_sampling_profiler.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/synchronization/lock.h" #include "base/synchronization/lock.h"
#include "base/test/scoped_run_loop_timeout.h" #include "base/test/scoped_run_loop_timeout.h"
...@@ -25,6 +26,10 @@ ...@@ -25,6 +26,10 @@
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
#endif #endif
#if defined(OS_MAC)
#include "base/mac/mac_util.h"
#endif
namespace { namespace {
// Class that intercepts and stores profiles provided to the // Class that intercepts and stores profiles provided to the
...@@ -120,6 +125,20 @@ class StackSamplingBrowserTest : public PlatformBrowserTest { ...@@ -120,6 +125,20 @@ class StackSamplingBrowserTest : public PlatformBrowserTest {
} }
}; };
bool ShouldSkipTestForMacOS11() {
#if defined(OS_MAC)
// Sampling profiler does not work and is disabled on macOS 11.
// See https://crbug.com/1101399 and https://crbug.com/1098119.
// DCHECK that that remains the case so these tests are re-enabled when the
// sampling profiler is re-enabled there.
if (base::mac::IsAtLeastOS11()) {
DCHECK(!base::StackSamplingProfiler::IsSupported());
return true;
}
#endif
return false;
}
// Wait for a profile with the specified properties. // Wait for a profile with the specified properties.
bool WaitForProfile(metrics::SampledProfile::TriggerEvent trigger_event, bool WaitForProfile(metrics::SampledProfile::TriggerEvent trigger_event,
metrics::Process process, metrics::Process process,
...@@ -155,42 +174,58 @@ bool WaitForProfile(metrics::SampledProfile::TriggerEvent trigger_event, ...@@ -155,42 +174,58 @@ bool WaitForProfile(metrics::SampledProfile::TriggerEvent trigger_event,
// were dropped as a result of bugs introduced by mojo refactorings. // were dropped as a result of bugs introduced by mojo refactorings.
IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, BrowserProcessMainThread) { IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, BrowserProcessMainThread) {
if (ShouldSkipTestForMacOS11())
GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP, EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::BROWSER_PROCESS, metrics::MAIN_THREAD)); metrics::BROWSER_PROCESS, metrics::MAIN_THREAD));
} }
IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, BrowserProcessIOThread) { IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, BrowserProcessIOThread) {
if (ShouldSkipTestForMacOS11())
GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP, EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::BROWSER_PROCESS, metrics::IO_THREAD)); metrics::BROWSER_PROCESS, metrics::IO_THREAD));
} }
IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, GpuProcessMainThread) { IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, GpuProcessMainThread) {
if (ShouldSkipTestForMacOS11())
GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP, EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::GPU_PROCESS, metrics::MAIN_THREAD)); metrics::GPU_PROCESS, metrics::MAIN_THREAD));
} }
IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, GpuProcessIOThread) { IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, GpuProcessIOThread) {
if (ShouldSkipTestForMacOS11())
GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP, EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::GPU_PROCESS, metrics::IO_THREAD)); metrics::GPU_PROCESS, metrics::IO_THREAD));
} }
IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, GpuProcessCompositorThread) { IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, GpuProcessCompositorThread) {
if (ShouldSkipTestForMacOS11())
GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP, EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::GPU_PROCESS, metrics::COMPOSITOR_THREAD)); metrics::GPU_PROCESS, metrics::COMPOSITOR_THREAD));
} }
IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, RendererProcessMainThread) { IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, RendererProcessMainThread) {
if (ShouldSkipTestForMacOS11())
GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP, EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::RENDERER_PROCESS, metrics::MAIN_THREAD)); metrics::RENDERER_PROCESS, metrics::MAIN_THREAD));
} }
IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, RendererProcessIOThread) { IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, RendererProcessIOThread) {
if (ShouldSkipTestForMacOS11())
GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP, EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::RENDERER_PROCESS, metrics::IO_THREAD)); metrics::RENDERER_PROCESS, metrics::IO_THREAD));
} }
IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest,
RendererProcessCompositorThread) { RendererProcessCompositorThread) {
if (ShouldSkipTestForMacOS11())
GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP, EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::RENDERER_PROCESS, metrics::RENDERER_PROCESS,
metrics::COMPOSITOR_THREAD)); metrics::COMPOSITOR_THREAD));
...@@ -205,6 +240,8 @@ IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, ...@@ -205,6 +240,8 @@ IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest,
#endif #endif
IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest, IN_PROC_BROWSER_TEST_F(StackSamplingBrowserTest,
MAYBE_NetworkServiceProcessIOThread) { MAYBE_NetworkServiceProcessIOThread) {
if (ShouldSkipTestForMacOS11())
GTEST_SKIP() << "Stack sampler is not supported on macOS 11.";
EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP, EXPECT_TRUE(WaitForProfile(metrics::SampledProfile::PROCESS_STARTUP,
metrics::NETWORK_SERVICE_PROCESS, metrics::NETWORK_SERVICE_PROCESS,
metrics::IO_THREAD)); metrics::IO_THREAD));
......
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