Tests must use locking to avoid race (fixes #2394)

This commit is contained in:
Jakob Borg
2015-10-20 08:51:14 +02:00
parent 1087535d8f
commit 0f9fa9507e
3 changed files with 30 additions and 24 deletions

View File

@@ -136,3 +136,9 @@ func (t *ProgressEmitter) BytesCompleted(folder string) (bytes int64) {
func (t *ProgressEmitter) String() string {
return fmt.Sprintf("ProgressEmitter@%p", t)
}
func (t *ProgressEmitter) lenRegistry() int {
t.mut.Lock()
defer t.mut.Unlock()
return len(t.registry)
}