Commit c0a311ba authored by Caleb Raitto's avatar Caleb Raitto Committed by Commit Bot

Disable leaking components_unittests on LSAN.

See crrev.com/c/1590404 and the linked bug for context -- the goal is to
fix the broken memory-leak checking in Chromium's ASAN
(AddressSanitizer) trybots, which are supposed to also run LSAN
(LeakSanitizer).

Currently-leaking tests must be fixed or disabled before leak checking
can be enabled in the ASAN trybot.

WARNING: This will result in a loss of ASAN coverage for the affected
tests given that LSAN runs as part of the ASAN trybot.

If that's not acceptable, we can wait until the leaks are fixed before
fixing leak detection in trybots, but keep in mind that newly-introduced
leaks Chromium-wide won't be caught until then.

Bug: 961023
Change-Id: I1899fbea3d1ce8288c954c97d4d486bd3cda3371
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1638818
Commit-Queue: Caleb Raitto <caraitto@chromium.org>
Reviewed-by: default avatarJared Saul <jsaul@google.com>
Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Reviewed-by: default avatarPatrick Noland <pnoland@chromium.org>
Reviewed-by: default avatarRobert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666059}
parent ae9e1c96
......@@ -25,6 +25,13 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
// TODO(crbug.com/961023): Fix memory leaks in tests and re-enable on LSAN.
#ifdef LEAK_SANITIZER
#define MAYBE_BuildRequestAuthenticated DISABLED_BuildRequestAuthenticated
#else
#define MAYBE_BuildRequestAuthenticated BuildRequestAuthenticated
#endif
namespace ntp_snippets {
namespace internal {
......@@ -110,7 +117,7 @@ class JsonRequestTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(JsonRequestTest);
};
TEST_F(JsonRequestTest, BuildRequestAuthenticated) {
TEST_F(JsonRequestTest, MAYBE_BuildRequestAuthenticated) {
JsonRequest::Builder builder = CreateMinimalBuilder();
RequestParams params;
params.excluded_ids = {"1234567890"};
......
......@@ -61,6 +61,19 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
// TODO(crbug.com/961023): Fix memory leaks in tests and re-enable on LSAN.
#ifdef LEAK_SANITIZER
#define MAYBE_TestSetBlacklistBoolDueToBlackListState \
DISABLED_TestSetBlacklistBoolDueToBlackListState
#define MAYBE_TestDisallowPreviewBecauseOfBlackListState \
DISABLED_TestDisallowPreviewBecauseOfBlackListState
#else
#define MAYBE_TestSetBlacklistBoolDueToBlackListState \
TestSetBlacklistBoolDueToBlackListState
#define MAYBE_TestDisallowPreviewBecauseOfBlackListState \
TestDisallowPreviewBecauseOfBlackListState
#endif
namespace previews {
namespace {
......@@ -515,7 +528,8 @@ TEST_F(PreviewsDeciderImplTest, TestDisallowBasicAuthentication) {
// Tests most of the reasons that a preview could be disallowed because of the
// state of the blacklist. Excluded values are USER_RECENTLY_OPTED_OUT,
// USER_BLACKLISTED, HOST_BLACKLISTED. These are internal to the blacklist.
TEST_F(PreviewsDeciderImplTest, TestDisallowPreviewBecauseOfBlackListState) {
TEST_F(PreviewsDeciderImplTest,
MAYBE_TestDisallowPreviewBecauseOfBlackListState) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(features::kPreviews);
base::HistogramTester histogram_tester;
......@@ -562,7 +576,7 @@ TEST_F(PreviewsDeciderImplTest, TestDisallowPreviewBecauseOfBlackListState) {
variations::testing::ClearAllVariationParams();
}
TEST_F(PreviewsDeciderImplTest, TestSetBlacklistBoolDueToBlackListState) {
TEST_F(PreviewsDeciderImplTest, MAYBE_TestSetBlacklistBoolDueToBlackListState) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(features::kPreviews);
......
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