Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eventing: fix bucket cache tests for non-default collection
Change-Id: I3d5e84066147e2da43e694adfcd008652c498e73 Reviewed-on: http://review.couchbase.org/c/testrunner/+/158534 Reviewed-by: Chanabasappa Ghali <chanabasappa.ghali@couchbase.com> Tested-by: Chanabasappa Ghali <chanabasappa.ghali@couchbase.com>
- Loading branch information
Showing
3 changed files
with
110 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
pytests/eventing/handler_code/ABO/cache_overflow_non_default_collection.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
function OnUpdate(doc, meta) { | ||
var value = {'big number': '1'.repeat(10*1024*1024), 'overflow': false}; | ||
for(var i=1;i<=8;i++) | ||
{ | ||
var result= couchbase.insert(dst_bucket, {id: meta.id + i.toString()}, value); | ||
log(result); | ||
couchbase.get(dst_bucket, {id: meta.id + i.toString()}, {"cache": true}); | ||
} | ||
var create_index=CREATE PRIMARY INDEX ON dst_bucket.dst_bucket.dst_bucket; | ||
var query=UPDATE dst_bucket.dst_bucket.dst_bucket SET overflow = true; | ||
log(query,meta.id); | ||
var check = false; | ||
for(var i=1;i<=8;i++) | ||
{ | ||
var a=couchbase.get(dst_bucket, {id: meta.id + i.toString()}, {"cache": true}); | ||
log(a.doc.overflow); | ||
if(a.doc.overflow == true) | ||
{ | ||
check=true; | ||
break; | ||
} | ||
} | ||
if(check) | ||
{ | ||
var result1= couchbase.insert(dst_bucket1,meta,doc); | ||
log(result1); | ||
} | ||
|
||
|
||
} | ||
|
||
function OnDelete(meta, options) { | ||
for(var i=1;i<=8;i++) | ||
{ | ||
var result = couchbase.delete(dst_bucket,{id:meta.id + i.toString()}); | ||
log(result); | ||
} | ||
var doc={"id":meta.id} | ||
var result1 = couchbase.delete(dst_bucket1,doc); | ||
log(result1); | ||
} |
41 changes: 41 additions & 0 deletions
41
pytests/eventing/handler_code/ABO/cache_underflow_non_default_collection.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
function OnUpdate(doc, meta) { | ||
var value = {'big number': '1'.repeat(10*1024*1024), 'underflow': false}; | ||
for(var i=1;i<=6;i++) | ||
{ | ||
var result= couchbase.insert(dst_bucket, {id: meta.id + i.toString()}, value); | ||
log(result); | ||
couchbase.get(dst_bucket, {id: meta.id + i.toString()}, {"cache": true}); | ||
} | ||
var create_index=CREATE PRIMARY INDEX ON dst_bucket.dst_bucket.dst_bucket; | ||
var query=UPDATE dst_bucket.dst_bucket.dst_bucket SET underflow = true; | ||
log(query,meta.id); | ||
var check = false; | ||
for(var i=1;i<=6;i++) | ||
{ | ||
var a=couchbase.get(dst_bucket, {id: meta.id + i.toString()}, {"cache": true}); | ||
log(a.doc.underflow); | ||
if(a.doc.underflow == true) | ||
{ | ||
check=true; | ||
break; | ||
} | ||
} | ||
if(!check) | ||
{ | ||
var result1= couchbase.insert(dst_bucket1,meta,doc); | ||
log(result1); | ||
} | ||
|
||
|
||
} | ||
|
||
function OnDelete(meta, options) { | ||
for(var i=1;i<=6;i++) | ||
{ | ||
var result = couchbase.delete(dst_bucket,{id:meta.id + i.toString()}); | ||
log(result); | ||
} | ||
var doc={"id":meta.id} | ||
var result1 = couchbase.delete(dst_bucket1,doc); | ||
log(result1); | ||
} |