forked from TrueCloudLab/frostfs-node
[#667] writecache: Fix flush test
Allow to disable background flusher for testing purposes. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
02454df14a
commit
8d18fa159e
8 changed files with 40 additions and 36 deletions
|
@ -44,6 +44,8 @@ type options struct {
|
|||
openFile func(string, int, fs.FileMode) (*os.File, error)
|
||||
// metrics is metrics implementation
|
||||
metrics writecache.Metrics
|
||||
// disableBackgroundFlush is for testing purposes only.
|
||||
disableBackgroundFlush bool
|
||||
}
|
||||
|
||||
// WithLogger sets logger.
|
||||
|
@ -155,3 +157,10 @@ func WithMetrics(metrics writecache.Metrics) Option {
|
|||
o.metrics = metrics
|
||||
}
|
||||
}
|
||||
|
||||
// WithDisableBackgroundFlush disables background flush, for testing purposes only.
|
||||
func WithDisableBackgroundFlush() Option {
|
||||
return func(o *options) {
|
||||
o.disableBackgroundFlush = true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue