Commit 753b30fd authored by Eric Roman's avatar Eric Roman Committed by Commit Bot

Fix flakiness of ProxyConfigServiceLinuxTest.KDEFileChanged.

Bug: 907673
Change-Id: I5c355e2cba9398b919e6a14d6fb817332c43a0d2
Reviewed-on: https://chromium-review.googlesource.com/c/1351284Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Commit-Queue: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610940}
parent 208bb982
......@@ -22,6 +22,7 @@
#include "base/strings/stringprintf.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/task_scheduler/task_scheduler.h"
#include "base/threading/thread.h"
#include "base/threading/thread_task_runner_handle.h"
#include "net/proxy_resolution/proxy_config.h"
......@@ -1852,16 +1853,9 @@ void WriteFile(const base::FilePath& path, base::StringPiece data) {
EXPECT_TRUE(base::WriteFile(path, data.data(), data.size()));
}
// TODO(https://crbug.com/907673): Undiagnosed flakiness on ASAN and TSAN bots.
#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER)
#define MAYBE_KDEFileChanged DISABLED_KDEFileChanged
#else
#define MAYBE_KDEFileChanged KDEFileChanged
#endif
// Tests that the KDE proxy config service watches for file and directory
// changes.
TEST_F(ProxyConfigServiceLinuxTest, MAYBE_KDEFileChanged) {
TEST_F(ProxyConfigServiceLinuxTest, KDEFileChanged) {
// Set up the initial .kde kioslaverc file.
WriteFile(kioslaverc_,
"[Proxy Settings]\nProxyType=2\n"
......@@ -1886,6 +1880,11 @@ TEST_F(ProxyConfigServiceLinuxTest, MAYBE_KDEFileChanged) {
// observed.
sync_config_getter.SetExpectedPacUrl("http://version2/wpad.dat");
// Initialization posts a task to start watching kioslaverc file. Ensure that
// registration has happened before modifying it or the file change won't be
// observed.
base::TaskScheduler::GetInstance()->FlushForTesting();
WriteFile(kioslaverc_,
"[Proxy Settings]\nProxyType=2\n"
"Proxy Config Script=http://version2/wpad.dat\n");
......
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