Skip to content

Commit

Permalink
[Sync] Fix flaky test testDownloadMovedBookmark()
Browse files Browse the repository at this point in the history
Recently, the USS version of bookmarks has been enabled on bots [1].
One difference between the old and the new implementation is the order
of the returned nodes for debugging.
Old implementation used the order in the directory, and hence they order
was been stable.

USS returns the order of appears in the bookmark hierarchy and hence it's
not stable across moves.

Since this flaky test is testing moving bookmarks, it shouldn't make
any assumptions about the order of the returned bookmarks.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1458442

Bug: 930729
Change-Id: I828c84275ed26815cd07611f1eacf75d1037482f
Reviewed-on: https://chromium-review.googlesource.com/c/1466644
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Auto-Submit: Mohamed Amir Yosef <mamir@chromium.org>
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631612}
  • Loading branch information
mohamedamir authored and Commit Bot committed Feb 13, 2019
1 parent 09eb191 commit 2d87664
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.bookmarks.BookmarkBridge;
Expand Down Expand Up @@ -168,7 +167,6 @@ public void testDownloadBookmarkTombstone() throws Exception {
@Test
@LargeTest
@Feature({"Sync"})
@DisabledTest // https://crbug.com/930729
public void testDownloadMovedBookmark() throws Exception {
// Add the entity to test moving.
addServerBookmark(TITLE, URL);
Expand Down Expand Up @@ -203,8 +201,9 @@ public void testDownloadMovedBookmark() throws Exception {
mSyncTestRule.pollInstrumentationThread(new ClientBookmarksCriteria() {
@Override
public boolean isSatisfied(List<Bookmark> bookmarks) {
Bookmark modifiedBookmark = bookmarks.get(bookmarks.get(0).isFolder() ? 1 : 0);
// The "s" is prepended because the server adds one to the parentId.
return bookmarks.get(bookmarkIndex).parentId.equals("s" + folder.id);
return modifiedBookmark.parentId.equals("s" + folder.id);
}
});
}
Expand Down

0 comments on commit 2d87664

Please sign in to comment.