Commit 76bc9186 authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Fix flakiness in TwoClientSessionsSyncTest

It seems like, in rare cases, the local changes sync up to the server
before the test has the chance to assert that local changes are pending.
Since the condition is not crucial for the test, let's just skip it.

Bug: 956043
Change-Id: Ia515d174aeae3f8ccf5648e46ed79e685d9e29e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1731934
Auto-Submit: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683521}
parent e16e2ddf
......@@ -340,18 +340,6 @@ bool ProfileSyncServiceHarness::StartSyncService() {
return true;
}
bool ProfileSyncServiceHarness::HasUnsyncedItems() {
base::RunLoop loop;
bool result = false;
service()->HasUnsyncedItemsForTest(
base::BindLambdaForTesting([&](bool has_unsynced_items) {
result = has_unsynced_items;
loop.Quit();
}));
loop.Run();
return result;
}
bool ProfileSyncServiceHarness::AwaitMutualSyncCycleCompletion(
ProfileSyncServiceHarness* partner) {
std::vector<ProfileSyncServiceHarness*> harnesses;
......
......@@ -104,11 +104,6 @@ class ProfileSyncServiceHarness {
// Starts the sync service after a previous stop.
bool StartSyncService();
// Returns whether this client has unsynced items. Avoid verifying false
// return values, because tests typically shouldn't make assumptions about
// other datatypes.
bool HasUnsyncedItems();
// Calling this acts as a barrier and blocks the caller until |this| and
// |partner| have both completed a sync cycle. When calling this method,
// the |partner| should be the passive responder who responds to the actions
......
......@@ -191,7 +191,6 @@ IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, DeleteIdleSession) {
// Client 1 now deletes client 0's tabs. This frees the memory of sessions1.
DeleteForeignSession(1, sessions1[0]->session_tag);
ASSERT_TRUE(GetClient(1)->HasUnsyncedItems());
ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0)));
EXPECT_FALSE(GetSessionData(1, &sessions1));
}
......@@ -212,7 +211,6 @@ IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, DeleteActiveSession) {
// Client 1 now deletes client 0's tabs. This frees the memory of sessions1.
DeleteForeignSession(1, sessions1[0]->session_tag);
ASSERT_TRUE(GetClient(1)->HasUnsyncedItems());
ASSERT_TRUE(GetClient(1)->AwaitMutualSyncCycleCompletion(GetClient(0)));
ASSERT_FALSE(GetSessionData(1, &sessions1));
......
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