@@ -277,6 +277,9 @@ func TestLRURevisionCacheEvictionMixedRevAndCV(t *testing.T) {
277277}
278278
279279func TestLRURevisionCacheEvictionMemoryBased (t * testing.T ) {
280+ if base .TestDisableRevCache () {
281+ t .Skip ("Revision cache disabled, eviction test needs revision cache enabled" )
282+ }
280283 testCases := []struct {
281284 name string
282285 UseCVCache bool
@@ -691,6 +694,9 @@ func TestBypassRevisionCache(t *testing.T) {
691694// Ensure attachment properties aren't being incorrectly stored in revision cache body when inserted via Put
692695func TestPutRevisionCacheAttachmentProperty (t * testing.T ) {
693696
697+ if base .TestDisableRevCache () {
698+ t .Skip ("Revision cache expected to be used for this test" )
699+ }
694700 base .SetUpTestLogging (t , base .LevelInfo , base .KeyAll )
695701
696702 db , ctx := setupTestDB (t )
@@ -959,6 +965,9 @@ func TestImmediateRevCacheMemoryBasedEviction(t *testing.T) {
959965// - Add new doc that will take over the shard memory capacity and assert that that eviction takes place and
960966// all stats are as expected
961967func TestShardedMemoryEviction (t * testing.T ) {
968+ if base .TestDisableRevCache () {
969+ t .Skip ("Test is sharded revision cache specific" )
970+ }
962971 dbcOptions := DatabaseContextOptions {
963972 RevisionCacheOptions : & RevisionCacheOptions {
964973 MaxBytes : 160 ,
@@ -1009,6 +1018,9 @@ func TestShardedMemoryEviction(t *testing.T) {
10091018// - Test adding a doc to sharded revision cache that will immediately be evicted due to size
10101019// - Assert that stats look as expected
10111020func TestShardedMemoryEvictionWhenShardEmpty (t * testing.T ) {
1021+ if base .TestDisableRevCache () {
1022+ t .Skip ("test is sharded revision cache specific" )
1023+ }
10121024 dbcOptions := DatabaseContextOptions {
10131025 RevisionCacheOptions : & RevisionCacheOptions {
10141026 MaxBytes : 100 ,
@@ -1112,6 +1124,9 @@ func TestImmediateRevCacheItemBasedEviction(t *testing.T) {
11121124}
11131125
11141126func TestResetRevCache (t * testing.T ) {
1127+ if base .TestDisableRevCache () {
1128+ t .Skip ("Revision cache expected to be used for this test" )
1129+ }
11151130 dbcOptions := DatabaseContextOptions {
11161131 RevisionCacheOptions : & RevisionCacheOptions {
11171132 MaxBytes : 100 ,
@@ -1137,6 +1152,9 @@ func TestResetRevCache(t *testing.T) {
11371152}
11381153
11391154func TestBasicOperationsOnCacheWithMemoryStat (t * testing.T ) {
1155+ if base .TestDisableRevCache () {
1156+ t .Skip ("Revision cache expected to be used for this test" )
1157+ }
11401158 testCases := []struct {
11411159 name string
11421160 UseCVCache bool
@@ -1333,6 +1351,9 @@ func TestConcurrentLoad(t *testing.T) {
13331351}
13341352
13351353func TestRevisionCacheRemove (t * testing.T ) {
1354+ if base .TestDisableRevCache () {
1355+ t .Skip ("test requires revision cache to be enabled" )
1356+ }
13361357 db , ctx := setupTestDB (t )
13371358 defer db .Close (ctx )
13381359 collection , ctx := GetSingleDatabaseCollectionWithUser (ctx , t , db )
@@ -1375,6 +1396,9 @@ func TestRevisionCacheRemove(t *testing.T) {
13751396// - Assert each doc returned is the correct one (correct rev ID etc)
13761397// - Assert that each doc is found at the rev cache and no misses are reported
13771398func TestRevCacheHitMultiCollection (t * testing.T ) {
1399+ if base .TestDisableRevCache () {
1400+ t .Skip ("test requires revision cache to be enabled" )
1401+ }
13781402 base .TestRequiresCollections (t )
13791403
13801404 tb := base .GetTestBucket (t )
@@ -2226,6 +2250,9 @@ func TestPutRevHighRevCacheChurn(t *testing.T) {
22262250}
22272251
22282252func TestRevCacheOnDemandImportNoCache (t * testing.T ) {
2253+ if base .TestDisableRevCache () {
2254+ t .Skip ("test requires rev cache enabled" )
2255+ }
22292256 base .SkipImportTestsIfNotEnabled (t )
22302257
22312258 db , ctx := setupTestDB (t )
@@ -2255,6 +2282,9 @@ func TestRevCacheOnDemandImportNoCache(t *testing.T) {
22552282}
22562283
22572284func TestFetchBackupWithDeletedFlag (t * testing.T ) {
2285+ if base .TestDisableRevCache () {
2286+ t .Skip ("pending fix in CBG-5141" )
2287+ }
22582288 db , ctx := SetupTestDBWithOptions (t , DatabaseContextOptions {
22592289 // enable delta sync so CV revs are backed up
22602290 DeltaSyncOptions : DeltaSyncOptions {
@@ -2354,6 +2384,9 @@ func TestRemoveFromRevLookup(t *testing.T) {
23542384}
23552385
23562386func TestLoadFromBucketLegacyRevsThatAreBackedUpPreUpgrade (t * testing.T ) {
2387+ if base .TestDisableRevCache () {
2388+ t .Skip ("test requires rev cache enabled" )
2389+ }
23572390 db , ctx := SetupTestDBWithOptions (t , DatabaseContextOptions {
23582391 OldRevExpirySeconds : base .DefaultOldRevExpirySeconds ,
23592392 RevisionCacheOptions : & RevisionCacheOptions {
@@ -2561,6 +2594,9 @@ func TestUpdateDeltaRevCacheMemoryStatPanicMultipleEntries(t *testing.T) {
25612594}
25622595
25632596func TestEvictionOfRevIDKeysWhenNoItemInCVMap (t * testing.T ) {
2597+ if base .TestDisableRevCache () {
2598+ t .Skip ("test requires rev cache enabled for eviction to run" )
2599+ }
25642600 db , ctx := SetupTestDBWithOptions (t , DatabaseContextOptions {
25652601 OldRevExpirySeconds : base .DefaultOldRevExpirySeconds ,
25662602 RevisionCacheOptions : & RevisionCacheOptions {
@@ -2614,6 +2650,9 @@ func TestEvictionOfRevIDKeysWhenNoItemInCVMap(t *testing.T) {
26142650}
26152651
26162652func TestEvictionOfCVKeysWhenNoItemInRevMap (t * testing.T ) {
2653+ if base .TestDisableRevCache () {
2654+ t .Skip ("test requires rev cache enabled for eviction to run" )
2655+ }
26172656 db , ctx := SetupTestDBWithOptions (t , DatabaseContextOptions {
26182657 OldRevExpirySeconds : base .DefaultOldRevExpirySeconds ,
26192658 RevisionCacheOptions : & RevisionCacheOptions {
@@ -2681,6 +2720,9 @@ func TestEvictionOfCVKeysWhenNoItemInRevMap(t *testing.T) {
26812720
26822721func TestBasicLoadBackupRevCacheOnlyPopulateOneMap (t * testing.T ) {
26832722
2723+ if base .TestDisableRevCache () {
2724+ t .Skip ("test requires rev cache enabled" )
2725+ }
26842726 db , ctx := SetupTestDBWithOptions (t , DatabaseContextOptions {
26852727 OldRevExpirySeconds : base .DefaultOldRevExpirySeconds ,
26862728 RevisionCacheOptions : & RevisionCacheOptions {
@@ -2741,6 +2783,9 @@ func TestBasicLoadBackupRevCacheOnlyPopulateOneMap(t *testing.T) {
27412783}
27422784
27432785func TestItemResidentInCacheBackupRevLoaded (t * testing.T ) {
2786+ if base .TestDisableRevCache () {
2787+ t .Skip ("test requires rev cache enabled" )
2788+ }
27442789 testCases := []struct {
27452790 name string
27462791 useRevID bool
0 commit comments