set RBF sizes smaller for test

We end up hitting race detector limits on MacOS. This should mitigate
that.
This commit is contained in:
Seebs 2022-08-31 16:35:37 -05:00 committed by Kasey Rodgers
parent dad8211709
commit fb3e60f88a
3 changed files with 10 additions and 1 deletions

View file

@ -592,8 +592,14 @@ func prependOpts(opts [][]server.CommandOption, size int) [][]server.CommandOpti
return opts
}
// prependTestServerOpts prepends opts with the OpenInMemTranslateStore.
// prependTestServerOpts prepends opts with the OpenInMemTranslateStore,
// tweaks to initial startup delay, and storage config to disable fsync and
// specify a smaller RBF size.
func prependTestServerOpts(opts []server.CommandOption) []server.CommandOption {
cfg := pilosa.DefaultHolderConfig()
cfg.RBFConfig.FsyncEnabled = false
cfg.RBFConfig.MaxSize = (1 << 28)
cfg.RBFConfig.MaxWALSize = (1 << 28)
defaultOpts := []server.CommandOption{
server.OptCommandServerOptions(
pilosa.OptServerOpenTranslateStore(pilosa.OpenInMemTranslateStore),
@ -602,6 +608,7 @@ func prependTestServerOpts(opts []server.CommandOption) []server.CommandOption {
Backend: storage.DefaultBackend,
FsyncEnabled: false,
}),
pilosa.OptServerRBFConfig(cfg.RBFConfig),
),
}
return append(defaultOpts, opts...)

View file

@ -28,6 +28,7 @@ func NewHolder(tb testing.TB) *Holder {
cfg := pilosa.DefaultHolderConfig()
cfg.StorageConfig.FsyncEnabled = false
cfg.RBFConfig.FsyncEnabled = false
cfg.RBFConfig.MaxSize = (1 << 28)
h := &Holder{Holder: pilosa.NewHolder(path, cfg), tb: tb}
return h

View file

@ -24,6 +24,7 @@ func newIndex(tb testing.TB) *Index {
cfg := pilosa.DefaultHolderConfig()
cfg.StorageConfig.FsyncEnabled = false
cfg.RBFConfig.FsyncEnabled = false
cfg.RBFConfig.MaxSize = (1 << 28)
h := pilosa.NewHolder(path, cfg)
testhook.Cleanup(tb, func() {
h.Close()