• Mikel Astiz's avatar
    Fix flakiness in TwoClientPrintersSyncTest.ConflictResolution · 268c3258
    Mikel Astiz authored
    The hypothesis here is that the test outcome is, strictly speaking,
    non-deterministic, because a server with an eventual consistency model
    cannot guarantee how exactly a conflict will be resolved (although it
    will guarantee that clients converge). In this model, the last commit
    will win.
    
    We fix the previously existing test by making sure which of the two
    clients commits first to the server. This is achieved by mimic-ing an
    offline state (or poor connectivity compared to the other client).
    
    In order to verify the hypothesis, we add a second test that enables
    strong consistency model on the server (implemented as part of this
    patch), and hence relies on that mechanism to expect a deterministic
    outcome without having to put clients offline.
    
    Bug: 810408
    Change-Id: I2fa3fd8c941674344030a76e76f7855131c1908e
    Reviewed-on: https://chromium-review.googlesource.com/1249482
    Commit-Queue: Mikel Astiz <mastiz@chromium.org>
    Reviewed-by: default avatarTim Schumann <tschumann@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#594865}
    268c3258
fake_server.cc 15.8 KB