mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-08 20:07:51 +00:00
give each test its own InMemSchemator
This commit is contained in:
parent
4e7c72cc00
commit
7013910158
4 changed files with 9 additions and 3 deletions
|
|
@ -312,6 +312,12 @@ type inMemSchemator struct {
|
|||
schema Schema
|
||||
}
|
||||
|
||||
func NewInMemSchemator() *inMemSchemator {
|
||||
return &inMemSchemator{
|
||||
schema: make(Schema),
|
||||
}
|
||||
}
|
||||
|
||||
// Schema is an in-memory implementation of the Schemator Schema method.
|
||||
func (s *inMemSchemator) Schema(ctx context.Context) (Schema, error) {
|
||||
s.mu.RLock()
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ func DefaultHolderConfig() *HolderConfig {
|
|||
OpenIDAllocator: func(string, bool) (*idAllocator, error) { return &idAllocator{}, nil },
|
||||
TranslationSyncer: NopTranslationSyncer,
|
||||
Serializer: GobSerializer,
|
||||
Schemator: disco.InMemSchemator,
|
||||
Schemator: disco.NewInMemSchemator(),
|
||||
Sharder: disco.InMemSharder,
|
||||
CacheFlushInterval: defaultCacheFlushInterval,
|
||||
StatsClient: stats.NopStatsClient,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ func mustHolderConfig() *HolderConfig {
|
|||
cfg := DefaultHolderConfig()
|
||||
cfg.StorageConfig.FsyncEnabled = false
|
||||
cfg.RBFConfig.FsyncEnabled = false
|
||||
cfg.Schemator = disco.InMemSchemator
|
||||
cfg.Schemator = disco.NewInMemSchemator()
|
||||
cfg.Sharder = disco.InMemSharder
|
||||
return cfg
|
||||
}
|
||||
|
|
|
|||
2
index.go
2
index.go
|
|
@ -77,7 +77,7 @@ func NewIndex(holder *Holder, path, name string) (*Index, error) {
|
|||
holder: holder,
|
||||
trackExistence: true,
|
||||
|
||||
Schemator: disco.InMemSchemator,
|
||||
Schemator: disco.NewInMemSchemator(),
|
||||
serializer: NopSerializer,
|
||||
|
||||
translateStores: make(map[int]TranslateStore),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue