FlushRevisionCacheForTest creates a new revision cache. This is currently at the database level. Only use this in test code.
()
| 509 | |
| 510 | // FlushRevisionCacheForTest creates a new revision cache. This is currently at the database level. Only use this in test code. |
| 511 | func (db *DatabaseContext) FlushRevisionCacheForTest() { |
| 512 | backingStores := make(map[uint32]RevisionCacheBackingStore, len(db.CollectionByID)) |
| 513 | for i, v := range db.CollectionByID { |
| 514 | backingStores[i] = v |
| 515 | } |
| 516 | |
| 517 | db.revisionCache = NewRevisionCache( |
| 518 | db.Options.RevisionCacheOptions, |
| 519 | backingStores, |
| 520 | db.DbStats.Cache(), |
| 521 | ) |
| 522 | |
| 523 | } |
| 524 | |
| 525 | // TestBucketPoolWithIndexes runs a TestMain for packages that require creation of indexes |
| 526 | func TestBucketPoolWithIndexes(ctx context.Context, m *testing.M, tbpOptions base.TestBucketPoolOptions) { |