lib/model: Debug and test fixes (#5613)
This commit is contained in:
parent
73fa7a6e5b
commit
e7ae851900
|
@ -1940,15 +1940,6 @@ func sendIndexTo(prevSequence int64, conn protocol.Connection, folder string, fs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if shouldDebug() {
|
|
||||||
if fi.SequenceNo() < prevSequence+1 {
|
|
||||||
panic(fmt.Sprintln("sequence lower than requested, got:", fi.SequenceNo(), ", asked to start at:", prevSequence+1))
|
|
||||||
}
|
|
||||||
if f.Sequence > 0 && fi.SequenceNo() <= f.Sequence {
|
|
||||||
panic(fmt.Sprintln("non-increasing sequence, current:", fi.SequenceNo(), "<= previous:", f.Sequence))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
f = fi.(protocol.FileInfo)
|
f = fi.(protocol.FileInfo)
|
||||||
|
|
||||||
// Mark the file as invalid if any of the local bad stuff flags are set.
|
// Mark the file as invalid if any of the local bad stuff flags are set.
|
||||||
|
|
|
@ -370,14 +370,12 @@ func pullInvalidIgnored(t *testing.T, ft config.FolderType) {
|
||||||
|
|
||||||
fc.sendIndexUpdate()
|
fc.sendIndexUpdate()
|
||||||
|
|
||||||
timeout := time.NewTimer(5 * time.Second)
|
|
||||||
select {
|
select {
|
||||||
case ev := <-sub.C():
|
case ev := <-sub.C():
|
||||||
t.Fatalf("Errors while pulling: %v", ev)
|
t.Fatalf("Errors while pulling: %v", ev)
|
||||||
case <-timeout.C:
|
case <-time.After(5 * time.Second):
|
||||||
t.Fatalf("timed out before index was received")
|
t.Fatalf("timed out before index was received")
|
||||||
case <-done:
|
case <-done:
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fc.mut.Lock()
|
fc.mut.Lock()
|
||||||
|
@ -421,12 +419,10 @@ func pullInvalidIgnored(t *testing.T, ft config.FolderType) {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout = time.NewTimer(5 * time.Second)
|
|
||||||
select {
|
select {
|
||||||
case <-timeout.C:
|
case <-time.After(5 * time.Second):
|
||||||
t.Fatalf("timed out before index was received")
|
t.Fatalf("timed out before index was received")
|
||||||
case <-done:
|
case <-done:
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue