mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
lib/model: Fix flakyness of TestRequestRemoteRenameChanged (#5904)
This commit is contained in:
parent
15e51fc045
commit
fd847d4efe
@ -704,6 +704,8 @@ func TestRequestRemoteRenameChanged(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var gotA, gotB, gotConfl bool
|
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{})
|
done = make(chan struct{})
|
||||||
fc.mut.Lock()
|
fc.mut.Lock()
|
||||||
fc.indexFn = func(folder string, fs []protocol.FileInfo) {
|
fc.indexFn = func(folder string, fs []protocol.FileInfo) {
|
||||||
@ -723,7 +725,16 @@ func TestRequestRemoteRenameChanged(t *testing.T) {
|
|||||||
if gotB {
|
if gotB {
|
||||||
t.Error("Got more than one index update for", f.Name)
|
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-"):
|
case strings.HasPrefix(f.Name, "b.sync-conflict-"):
|
||||||
if gotConfl {
|
if gotConfl {
|
||||||
t.Error("Got more than one index update for conflicts of", f.Name)
|
t.Error("Got more than one index update for conflicts of", f.Name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user