Commit 0cd509b9 authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Fix flakiness in ReusesSameCacheGuid

Blocking calls to base::ReadFileToString() must be preceded by
base::ScopedAllowBlockingForTesting.

Bug: 1004312
Change-Id: I33b421436b7c8483ff8fa646fb15caa2f7f240a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1853264
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Auto-Submit: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704676}
parent 88d787cc
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/test/scoped_feature_list.h" #include "base/test/scoped_feature_list.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/defaults.h" #include "chrome/browser/defaults.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
...@@ -193,14 +194,8 @@ IN_PROC_BROWSER_TEST_F(SingleClientSecondaryAccountSyncTest, ...@@ -193,14 +194,8 @@ IN_PROC_BROWSER_TEST_F(SingleClientSecondaryAccountSyncTest,
// The unconsented primary account (aka secondary account) isn't supported on // The unconsented primary account (aka secondary account) isn't supported on
// ChromeOS, see IdentityManager::ComputeUnconsentedPrimaryAccountInfo(). // ChromeOS, see IdentityManager::ComputeUnconsentedPrimaryAccountInfo().
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS)
// Flaky on ASan/TSan, crbug.com/1004312.
#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER)
#define MAYBE_ReusesSameCacheGuid DISABLED_ReusesSameCacheGuid
#else
#define MAYBE_ReusesSameCacheGuid ReusesSameCacheGuid
#endif
IN_PROC_BROWSER_TEST_F(SingleClientSecondaryAccountSyncTest, IN_PROC_BROWSER_TEST_F(SingleClientSecondaryAccountSyncTest,
MAYBE_ReusesSameCacheGuid) { ReusesSameCacheGuid) {
ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
ASSERT_TRUE(GetClient(0)->AwaitSyncTransportActive()); ASSERT_TRUE(GetClient(0)->AwaitSyncTransportActive());
...@@ -214,6 +209,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientSecondaryAccountSyncTest, ...@@ -214,6 +209,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientSecondaryAccountSyncTest,
ASSERT_FALSE(prefs.GetCacheGuid().empty()); ASSERT_FALSE(prefs.GetCacheGuid().empty());
std::string old_cache_guid; std::string old_cache_guid;
base::ScopedAllowBlockingForTesting allow_blocking;
ASSERT_TRUE( ASSERT_TRUE(
base::ReadFileToString(GetTestFilePathForCacheGuid(), &old_cache_guid)); base::ReadFileToString(GetTestFilePathForCacheGuid(), &old_cache_guid));
ASSERT_FALSE(old_cache_guid.empty()); ASSERT_FALSE(old_cache_guid.empty());
......
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