@@ -58,6 +58,19 @@ describe('#bucketmanager', function () {
5858 if ( ! H . supportsFeature ( H . Features . StorageBackend ) ) {
5959 expected . storageBackend = undefined
6060 }
61+ if ( H . supportsFeature ( H . Features . NumVbucketsSetting ) ) {
62+ expected . numVBuckets = 1024
63+ } else {
64+ expected . numVBuckets = undefined
65+ }
66+ if ( H . isServerVersionAtLeast ( 8 , 0 , 0 ) ) {
67+ expected . storageBackend = 'magma'
68+ expected . historyRetentionCollectionDefault = true
69+ expected . historyRetentionBytes = 0
70+ expected . historyRetentionDuration = 0
71+ expected . replicaIndexes = undefined
72+ expected . numVBuckets = 128
73+ }
6174 assert . deepStrictEqual ( res , expected )
6275 } )
6376
@@ -99,14 +112,31 @@ describe('#bucketmanager', function () {
99112 it ( 'should return an InvalidArgument error when updating a couchstore bucket with history' , async function ( ) {
100113 H . skipIfMissingFeature ( this , H . Features . BucketDedup )
101114
115+ let bucketName = testBucket
102116 var bmgr = H . c . buckets ( )
117+ if ( H . isServerVersionAtLeast ( 8 , 0 , 0 ) ) {
118+ bucketName = H . genTestKey ( )
119+ await bmgr . createBucket ( {
120+ name : bucketName ,
121+ flushEnabled : true ,
122+ ramQuotaMB : 256 ,
123+ storageBackend : StorageBackend . Couchstore ,
124+ } )
125+ await H . consistencyUtils . waitUntilBucketPresent ( bucketName )
126+ }
127+
103128 await H . throwsHelper ( async ( ) => {
104129 await bmgr . updateBucket ( {
105- name : testBucket ,
130+ name : bucketName ,
106131 historyRetentionCollectionDefault : true ,
107132 ramQuotaMB : 1024 ,
108133 } )
109134 } , H . lib . InvalidArgumentError )
135+
136+ if ( H . isServerVersionAtLeast ( 8 , 0 , 0 ) ) {
137+ await bmgr . dropBucket ( bucketName )
138+ await H . consistencyUtils . waitUntilBucketDropped ( bucketName )
139+ }
110140 } )
111141
112142 it ( 'should error when trying to flush an unflushable bucket' , async function ( ) {
@@ -131,12 +161,16 @@ describe('#bucketmanager', function () {
131161
132162 it ( 'should successfully create a bucket with flush and replicaIndexes disabled' , async function ( ) {
133163 var bmgr = H . c . buckets ( )
134- await bmgr . createBucket ( {
164+ const settings = {
135165 name : testBucket ,
136166 flushEnabled : false ,
137167 replicaIndexes : false ,
138168 ramQuotaMB : 256 ,
139- } )
169+ }
170+ if ( H . isServerVersionAtLeast ( 8 , 0 , 0 ) ) {
171+ settings . storageBackend = StorageBackend . Couchstore
172+ }
173+ await bmgr . createBucket ( settings )
140174 await H . consistencyUtils . waitUntilBucketPresent ( testBucket )
141175
142176 var res = await bmgr . getBucket ( testBucket )
@@ -160,6 +194,11 @@ describe('#bucketmanager', function () {
160194 if ( ! H . supportsFeature ( H . Features . StorageBackend ) ) {
161195 expected . storageBackend = undefined
162196 }
197+ if ( H . supportsFeature ( H . Features . NumVbucketsSetting ) ) {
198+ expected . numVBuckets = 1024
199+ } else {
200+ expected . numVBuckets = undefined
201+ }
163202 assert . deepStrictEqual ( res , expected )
164203
165204 await bmgr . dropBucket ( testBucket )
@@ -197,6 +236,11 @@ describe('#bucketmanager', function () {
197236 historyRetentionBytes : 2147483648 ,
198237 historyRetentionDuration : 13000 ,
199238 }
239+ if ( H . supportsFeature ( H . Features . NumVbucketsSetting ) ) {
240+ expected . numVBuckets = H . isServerVersionAtLeast ( 8 , 0 , 0 ) ? 128 : 1024
241+ } else {
242+ expected . numVBuckets = undefined
243+ }
200244
201245 assert . deepStrictEqual ( res , expected )
202246 } ) . timeout ( 10 * 1000 )
@@ -231,6 +275,11 @@ describe('#bucketmanager', function () {
231275 historyRetentionBytes : 0 ,
232276 historyRetentionDuration : 14000 ,
233277 }
278+ if ( H . supportsFeature ( H . Features . NumVbucketsSetting ) ) {
279+ expected . numVBuckets = H . isServerVersionAtLeast ( 8 , 0 , 0 ) ? 128 : 1024
280+ } else {
281+ expected . numVBuckets = undefined
282+ }
234283
235284 assert . deepStrictEqual ( res , expected )
236285
0 commit comments