Commit 9e909ee8 authored by Caleb Raitto's avatar Caleb Raitto Committed by Commit Bot

Disable leaking device_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: 961039,969160
Change-Id: Ied0a27fde7a99c5d801a49adc235c712e5fedce2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1638923
Commit-Queue: Caleb Raitto <caraitto@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarMatt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666304}
parent 25589b72
...@@ -43,6 +43,24 @@ ...@@ -43,6 +43,24 @@
#include "device/bluetooth/test/bluetooth_test_fuchsia.h" #include "device/bluetooth/test/bluetooth_test_fuchsia.h"
#endif #endif
// TODO(crbug.com/969160): Fix memory leaks in tests and re-enable on LSAN.
#ifdef LEAK_SANITIZER
#define MAYBE_GetMergedDiscoveryFilterTransport \
DISABLED_GetMergedDiscoveryFilterTransport
#define MAYBE_GetMergedDiscoveryFilterRegular \
DISABLED_GetMergedDiscoveryFilterRegular
#define MAYBE_GetMergedDiscoveryFilterRssi DISABLED_GetMergedDiscoveryFilterRssi
#define MAYBE_GetMergedDiscoveryFilterAllFields \
DISABLED_GetMergedDiscoveryFilterAllFields
#else
#define MAYBE_GetMergedDiscoveryFilterTransport \
GetMergedDiscoveryFilterTransport
#define MAYBE_GetMergedDiscoveryFilterRegular GetMergedDiscoveryFilterRegular
#define MAYBE_GetMergedDiscoveryFilterRssi GetMergedDiscoveryFilterRssi
#define MAYBE_GetMergedDiscoveryFilterAllFields \
GetMergedDiscoveryFilterAllFields
#endif
using device::BluetoothDevice; using device::BluetoothDevice;
namespace device { namespace device {
...@@ -262,7 +280,7 @@ TEST(BluetoothAdapterTest, GetMergedDiscoveryFilterEmpty) { ...@@ -262,7 +280,7 @@ TEST(BluetoothAdapterTest, GetMergedDiscoveryFilterEmpty) {
EXPECT_TRUE(discovery_filter.get() == nullptr); EXPECT_TRUE(discovery_filter.get() == nullptr);
} }
TEST(BluetoothAdapterTest, GetMergedDiscoveryFilterRegular) { TEST(BluetoothAdapterTest, MAYBE_GetMergedDiscoveryFilterRegular) {
scoped_refptr<TestBluetoothAdapter> adapter = new TestBluetoothAdapter(); scoped_refptr<TestBluetoothAdapter> adapter = new TestBluetoothAdapter();
std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter; std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter;
...@@ -281,7 +299,7 @@ TEST(BluetoothAdapterTest, GetMergedDiscoveryFilterRegular) { ...@@ -281,7 +299,7 @@ TEST(BluetoothAdapterTest, GetMergedDiscoveryFilterRegular) {
adapter->CleanupSessions(); adapter->CleanupSessions();
} }
TEST(BluetoothAdapterTest, GetMergedDiscoveryFilterRssi) { TEST(BluetoothAdapterTest, MAYBE_GetMergedDiscoveryFilterRssi) {
scoped_refptr<TestBluetoothAdapter> adapter = new TestBluetoothAdapter(); scoped_refptr<TestBluetoothAdapter> adapter = new TestBluetoothAdapter();
int16_t resulting_rssi; int16_t resulting_rssi;
uint16_t resulting_pathloss; uint16_t resulting_pathloss;
...@@ -342,7 +360,7 @@ TEST(BluetoothAdapterTest, GetMergedDiscoveryFilterRssi) { ...@@ -342,7 +360,7 @@ TEST(BluetoothAdapterTest, GetMergedDiscoveryFilterRssi) {
adapter->CleanupSessions(); adapter->CleanupSessions();
} }
TEST(BluetoothAdapterTest, GetMergedDiscoveryFilterTransport) { TEST(BluetoothAdapterTest, MAYBE_GetMergedDiscoveryFilterTransport) {
scoped_refptr<TestBluetoothAdapter> adapter = new TestBluetoothAdapter(); scoped_refptr<TestBluetoothAdapter> adapter = new TestBluetoothAdapter();
std::unique_ptr<BluetoothDiscoveryFilter> resulting_filter; std::unique_ptr<BluetoothDiscoveryFilter> resulting_filter;
...@@ -387,7 +405,7 @@ TEST(BluetoothAdapterTest, GetMergedDiscoveryFilterTransport) { ...@@ -387,7 +405,7 @@ TEST(BluetoothAdapterTest, GetMergedDiscoveryFilterTransport) {
adapter->CleanupSessions(); adapter->CleanupSessions();
} }
TEST(BluetoothAdapterTest, GetMergedDiscoveryFilterAllFields) { TEST(BluetoothAdapterTest, MAYBE_GetMergedDiscoveryFilterAllFields) {
scoped_refptr<TestBluetoothAdapter> adapter = new TestBluetoothAdapter(); scoped_refptr<TestBluetoothAdapter> adapter = new TestBluetoothAdapter();
int16_t resulting_rssi; int16_t resulting_rssi;
std::set<device::BluetoothUUID> resulting_uuids; std::set<device::BluetoothUUID> resulting_uuids;
......
...@@ -19,6 +19,15 @@ ...@@ -19,6 +19,15 @@
#include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/connector.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
// TODO(crbug.com/961039): Fix memory leaks in tests and re-enable on LSAN.
#ifdef LEAK_SANITIZER
#define MAYBE_AddAndRemoveSwitchPro DISABLED_AddAndRemoveSwitchPro
#define MAYBE_UnsupportedDeviceIsIgnored DISABLED_UnsupportedDeviceIsIgnored
#else
#define MAYBE_AddAndRemoveSwitchPro AddAndRemoveSwitchPro
#define MAYBE_UnsupportedDeviceIsIgnored UnsupportedDeviceIsIgnored
#endif
namespace device { namespace device {
namespace { namespace {
...@@ -80,7 +89,7 @@ class NintendoDataFetcherTest : public DeviceServiceTestBase { ...@@ -80,7 +89,7 @@ class NintendoDataFetcherTest : public DeviceServiceTestBase {
DISALLOW_COPY_AND_ASSIGN(NintendoDataFetcherTest); DISALLOW_COPY_AND_ASSIGN(NintendoDataFetcherTest);
}; };
TEST_F(NintendoDataFetcherTest, UnsupportedDeviceIsIgnored) { TEST_F(NintendoDataFetcherTest, MAYBE_UnsupportedDeviceIsIgnored) {
// Simulate an unsupported, non-Nintendo HID device. // Simulate an unsupported, non-Nintendo HID device.
auto collection = mojom::HidCollectionInfo::New(); auto collection = mojom::HidCollectionInfo::New();
collection->usage = mojom::HidUsageAndPage::New(0, 0); collection->usage = mojom::HidUsageAndPage::New(0, 0);
...@@ -101,7 +110,7 @@ TEST_F(NintendoDataFetcherTest, UnsupportedDeviceIsIgnored) { ...@@ -101,7 +110,7 @@ TEST_F(NintendoDataFetcherTest, UnsupportedDeviceIsIgnored) {
RunUntilIdle(); RunUntilIdle();
} }
TEST_F(NintendoDataFetcherTest, AddAndRemoveSwitchPro) { TEST_F(NintendoDataFetcherTest, MAYBE_AddAndRemoveSwitchPro) {
// Simulate a Switch Pro over USB. // Simulate a Switch Pro over USB.
auto collection = mojom::HidCollectionInfo::New(); auto collection = mojom::HidCollectionInfo::New();
collection->usage = mojom::HidUsageAndPage::New(0, 0); collection->usage = mojom::HidUsageAndPage::New(0, 0);
......
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