@@ -725,27 +725,13 @@ func TestMultiXattrRoundtrip(t *testing.T) {
725725 xattrKeys [2 ]: []byte (`{"key3": "value3"}` ),
726726 }
727727 _ , err := dataStore .WriteWithXattrs (ctx , docID , 0 , 0 , []byte (`{"key": "value"}` ), inputXattrs , nil , nil )
728- if dataStore .IsSupported (sgbucket .BucketStoreFeatureMultiXattrSubdocOperations ) {
729- require .NoError (t , err )
730- } else {
731- require .ErrorContains (t , err , "invalid xattr key combination" )
732- inputXattrs = map [string ][]byte {
733- xattrKeys [0 ]: inputXattrs [xattrKeys [0 ]],
734- }
735- // write a document an xattrs, because subsequent GetXattrs needs a document to produce an error without multi-xattr support
736- _ , err := dataStore .WriteWithXattrs (ctx , docID , 0 , 0 , []byte (`{"key": "value"}` ), inputXattrs , nil , nil )
737- require .NoError (t , err )
738- }
728+ require .NoError (t , err )
739729
740730 xattrs , _ , err := dataStore .GetXattrs (ctx , docID , xattrKeys )
741- if dataStore .IsSupported (sgbucket .BucketStoreFeatureMultiXattrSubdocOperations ) {
742- require .NoError (t , err )
743- for _ , key := range xattrKeys {
744- require .Contains (t , maps .Keys (xattrs ), key )
745- require .JSONEq (t , string (inputXattrs [key ]), string (xattrs [key ]))
746- }
747- } else {
748- require .ErrorContains (t , err , "not supported" )
731+ require .NoError (t , err )
732+ for _ , key := range xattrKeys {
733+ require .Contains (t , maps .Keys (xattrs ), key )
734+ require .JSONEq (t , string (inputXattrs [key ]), string (xattrs [key ]))
749735 }
750736}
751737
@@ -2325,15 +2311,8 @@ func TestUserXattrGetWithXattr(t *testing.T) {
23252311 "_sync" : MustJSONMarshal (t , syncXattrVal ),
23262312 "test" : MustJSONMarshal (t , userXattrVal ),
23272313 }
2328- if bucket .IsSupported (sgbucket .BucketStoreFeatureMultiXattrSubdocOperations ) {
2329- _ , err = dataStore .UpdateXattrs (ctx , docKey , 0 , cas , xattrs , nil )
2330- require .NoError (t , err )
2331- } else {
2332- for k , v := range xattrs {
2333- cas , err = dataStore .UpdateXattrs (ctx , docKey , 0 , cas , map [string ][]byte {k : v }, nil )
2334- require .NoError (t , err )
2335- }
2336- }
2314+ _ , err = dataStore .UpdateXattrs (ctx , docKey , 0 , cas , xattrs , nil )
2315+ require .NoError (t , err )
23372316 var docValRet map [string ]any
23382317 docRaw , xattrsResult , _ , err := dataStore .GetWithXattrs (ctx , docKey , []string {SyncXattrName , "test" })
23392318 require .NoError (t , JSONUnmarshal (docRaw , & docValRet ))
@@ -2549,9 +2528,6 @@ func TestUpsertOptionPreserveExpiry(t *testing.T) {
25492528 bucket := GetTestBucket (t )
25502529 defer bucket .Close (ctx )
25512530 dataStore := bucket .GetSingleDataStore ()
2552- if ! bucket .IsSupported (sgbucket .BucketStoreFeaturePreserveExpiry ) {
2553- t .Skip ("Preserve expiry is not supported with this CBS version. Skipping test..." )
2554- }
25552531
25562532 testCases := []struct {
25572533 name string
@@ -2676,11 +2652,6 @@ func TestWriteWithXattrsBodyUpdateXattrDelete(t *testing.T) {
26762652 xattrBody := []byte (`{"some": "val"}` )
26772653
26782654 cas , err := collection .WriteWithXattrs (ctx , docID , 0 , 0 , []byte (`{"foo": "bar"}` ), map [string ][]byte {xattr1Name : xattrBody , xattr2Name : xattrBody }, nil , nil )
2679- // in Couchbase Server < 7.6, this will return an error because this is writing two xattrs
2680- if ! collection .IsSupported (sgbucket .BucketStoreFeatureMultiXattrSubdocOperations ) {
2681- require .ErrorContains (t , err , "SUBDOC_XATTR_INVALID_KEY_COMBO" )
2682- return
2683- }
26842655 require .NoError (t , err )
26852656
26862657 _ , err = collection .WriteWithXattrs (ctx , docID , 0 , cas , []byte (`{"foo": "baz"}` ), nil , []string {xattr1Name }, nil )
@@ -2706,10 +2677,6 @@ func TestWriteWithXattrsXattrWriteXattrDelete(t *testing.T) {
27062677 xattrBody := []byte (`{"some": "val"}` )
27072678
27082679 cas , err := collection .WriteWithXattrs (ctx , docID , 0 , 0 , []byte (`{"foo": "bar"}` ), map [string ][]byte {xattr1Name : xattrBody , xattr2Name : xattrBody }, nil , nil )
2709- if ! collection .IsSupported (sgbucket .BucketStoreFeatureMultiXattrSubdocOperations ) {
2710- require .ErrorContains (t , err , "SUBDOC_XATTR_INVALID_KEY_COMBO" )
2711- return
2712- }
27132680 require .NoError (t , err )
27142681
27152682 newXattrBody := []byte (`{"another" : "val"}` )
@@ -2746,9 +2713,6 @@ func TestWriteUpdateWithXattrsDocumentTombstone(t *testing.T) {
27462713
27472714 bucket := GetTestBucket (t )
27482715 defer bucket .Close (ctx )
2749- if ! bucket .IsSupported (sgbucket .BucketStoreFeatureMultiXattrSubdocOperations ) {
2750- t .Skip ("this test writes multiple xattrs" )
2751- }
27522716 dataStore := bucket .GetSingleDataStore ()
27532717 key := t .Name ()
27542718
0 commit comments