lib/model: Adjust remote-rename-test to timer-based versions (fixes #6625) (#6644)

This commit is contained in:
Simon Frei 2020-05-14 00:31:05 +02:00 committed by GitHub
parent 074097a8e7
commit 299b9d8883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 9 deletions

View File

@ -471,7 +471,7 @@ nextFile:
// map.
desired := fileDeletions[candidate.Name]
if err := f.renameFile(candidate, desired, fi, snap, dbUpdateChan, scanChan); err != nil {
l.Debugln("rename shortcut for %s failed: %S", fi.Name, err.Error())
l.Debugf("rename shortcut for %s failed: %s", fi.Name, err.Error())
// Failed to rename, try next one.
continue
}

View File

@ -720,8 +720,6 @@ 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(_ context.Context, folder string, fs []protocol.FileInfo) {
@ -742,16 +740,12 @@ func TestRequestRemoteRenameChanged(t *testing.T) {
if gotB {
t.Error("Got more than one index update for", f.Name)
}
if f.Version.Equal(bIntermediateVersion) {
if f.Version.Counter(fc.id.Short()) == 0 {
// 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)
gotB = true
case strings.HasPrefix(f.Name, "b.sync-conflict-"):
if gotConfl {
t.Error("Got more than one index update for conflicts of", f.Name)