forked from TrueCloudLab/frostfs-node
[#1705] engine: Use condition var for evacuation unit tests
To know exactly when the evacuation was completed, a conditional variable was added. Closes #1705 Change-Id: I86f6d7d2ad2b9759905b6b5e9341008cb74f5dfd Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
64c1392513
commit
e06ecacf57
3 changed files with 29 additions and 11 deletions
|
@ -212,12 +212,18 @@ func New(opts ...Option) *StorageEngine {
|
|||
opts[i](c)
|
||||
}
|
||||
|
||||
evLimMtx := &sync.RWMutex{}
|
||||
evLimCond := sync.NewCond(evLimMtx)
|
||||
|
||||
return &StorageEngine{
|
||||
cfg: c,
|
||||
shards: make(map[string]hashedShard),
|
||||
closeCh: make(chan struct{}),
|
||||
setModeCh: make(chan setModeRequest),
|
||||
evacuateLimiter: &evacuationLimiter{},
|
||||
cfg: c,
|
||||
shards: make(map[string]hashedShard),
|
||||
closeCh: make(chan struct{}),
|
||||
setModeCh: make(chan setModeRequest),
|
||||
evacuateLimiter: &evacuationLimiter{
|
||||
guard: evLimMtx,
|
||||
statusCond: evLimCond,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue