diff --git a/lib/model/requests_test.go b/lib/model/requests_test.go index 63fc6c588..97cc8bcdf 100644 --- a/lib/model/requests_test.go +++ b/lib/model/requests_test.go @@ -704,6 +704,8 @@ func TestRequestRemoteRenameChanged(t *testing.T) { } var gotA, gotB, gotConfl bool + bIntermediateVersion := protocol.Vector{}.Update(fc.id.Short()).Update(myID.Short()) + bFinalVersion := bIntermediateVersion.Copy().Update(fc.id.Short()) done = make(chan struct{}) fc.mut.Lock() fc.indexFn = func(folder string, fs []protocol.FileInfo) { @@ -723,7 +725,16 @@ func TestRequestRemoteRenameChanged(t *testing.T) { if gotB { t.Error("Got more than one index update for", f.Name) } - gotB = true + if f.Version.Equal(bIntermediateVersion) { + // This index entry might be superseeded + // by the final one or sent before it separately. + break + } + if f.Version.Equal(bFinalVersion) { + gotB = true + break + } + t.Errorf("Got unexpected version %v for file %v in index update", f.Version, f.Name) case strings.HasPrefix(f.Name, "b.sync-conflict-"): if gotConfl { t.Error("Got more than one index update for conflicts of", f.Name)