mirror of https://gitee.com/bigwinds/arangodb
Don't wait eternaly; don't unload collections with rocksdb (#9415)
This commit is contained in:
parent
e605c9cd2e
commit
3599aedda1
|
@ -863,6 +863,8 @@ function runInRSpec (options, instanceInfo, file, addArgs) {
|
|||
' c.ARANGO_PASSWORD = "' + options.password + '"\n' +
|
||||
' c.add_setting :SKIP_TIMECRITICAL\n' +
|
||||
' c.SKIP_TIMECRITICAL = ' + JSON.stringify(options.skipTimeCritical) + '\n' +
|
||||
' c.add_setting :STORAGE_ENGINE\n' +
|
||||
' c.STORAGE_ENGINE = ' + JSON.stringify(options.storageEngine) + '\n' +
|
||||
'end\n';
|
||||
|
||||
fs.write(tmpname, rspecConfig);
|
||||
|
|
|
@ -194,20 +194,25 @@ describe ArangoDB do
|
|||
|
||||
iid = doc.parsed_response['id']
|
||||
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
end
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
end
|
||||
cmd = api + "/#{iid}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ require 'arangodb.rb'
|
|||
describe ArangoDB do
|
||||
prefix = "api-index-hash"
|
||||
|
||||
################################################################################
|
||||
## unique constraints during create
|
||||
################################################################################
|
||||
################################################################################
|
||||
## unique constraints during create
|
||||
################################################################################
|
||||
|
||||
context "creating hash index:" do
|
||||
context "dealing with unique constraints violation:" do
|
||||
|
@ -17,11 +17,11 @@ describe ArangoDB do
|
|||
ArangoDB.drop_collection(@cn)
|
||||
@cid = ArangoDB.create_collection(@cn)
|
||||
end
|
||||
|
||||
|
||||
after do
|
||||
ArangoDB.drop_collection(@cn)
|
||||
end
|
||||
|
||||
|
||||
it "does not create the index in case of violation" do
|
||||
# create a document
|
||||
cmd1 = "/_api/document?collection=#{@cn}"
|
||||
|
@ -126,9 +126,9 @@ describe ArangoDB do
|
|||
end
|
||||
end
|
||||
|
||||
################################################################################
|
||||
## unique constraints during create
|
||||
################################################################################
|
||||
################################################################################
|
||||
## unique constraints during create
|
||||
################################################################################
|
||||
|
||||
context "creating documents:" do
|
||||
context "dealing with unique constraints:" do
|
||||
|
@ -137,11 +137,11 @@ describe ArangoDB do
|
|||
ArangoDB.drop_collection(@cn)
|
||||
@cid = ArangoDB.create_collection(@cn)
|
||||
end
|
||||
|
||||
|
||||
after do
|
||||
ArangoDB.drop_collection(@cn)
|
||||
end
|
||||
|
||||
|
||||
it "rolls back in case of violation, array index w/o deduplication" do
|
||||
cmd = "/_api/index?collection=#{@cn}"
|
||||
body = "{ \"type\" : \"hash\", \"unique\" : true, \"fields\" : [ \"a[*]\" ], \"deduplicate\": false }"
|
||||
|
@ -151,24 +151,24 @@ describe ArangoDB do
|
|||
doc.parsed_response['type'].should eq("hash")
|
||||
doc.parsed_response['unique'].should eq(true)
|
||||
doc.parsed_response['deduplicate'].should eq(false)
|
||||
|
||||
|
||||
# create a document
|
||||
cmd1 = "/_api/document?collection=#{@cn}"
|
||||
body = "{ \"a\" : [ 1 ] }"
|
||||
doc = ArangoDB.log_post("#{prefix}-create2", cmd1, :body => body)
|
||||
|
||||
doc.code.should eq(201)
|
||||
|
||||
|
||||
body = "{ \"a\" : [ 2 ] }"
|
||||
doc = ArangoDB.log_post("#{prefix}-create2", cmd1, :body => body)
|
||||
|
||||
doc.code.should eq(201)
|
||||
|
||||
|
||||
body = "{ \"a\" : [ 3, 4 ] }"
|
||||
doc = ArangoDB.log_post("#{prefix}-create2", cmd1, :body => body)
|
||||
|
||||
doc.code.should eq(201)
|
||||
|
||||
|
||||
doc.code.should eq(201)
|
||||
|
||||
# create a unique constraint violation
|
||||
|
@ -177,7 +177,7 @@ describe ArangoDB do
|
|||
|
||||
doc.code.should eq(409)
|
||||
end
|
||||
|
||||
|
||||
it "rolls back in case of violation, array index" do
|
||||
cmd = "/_api/index?collection=#{@cn}"
|
||||
body = "{ \"type\" : \"hash\", \"unique\" : true, \"fields\" : [ \"a[*]\" ] }"
|
||||
|
@ -187,24 +187,24 @@ describe ArangoDB do
|
|||
doc.parsed_response['type'].should eq("hash")
|
||||
doc.parsed_response['unique'].should eq(true)
|
||||
doc.parsed_response['deduplicate'].should eq(true)
|
||||
|
||||
|
||||
# create a document
|
||||
cmd1 = "/_api/document?collection=#{@cn}"
|
||||
body = "{ \"a\" : [ 1, 1 ] }"
|
||||
doc = ArangoDB.log_post("#{prefix}-create2", cmd1, :body => body)
|
||||
|
||||
doc.code.should eq(201)
|
||||
|
||||
|
||||
body = "{ \"a\" : [ 2 ] }"
|
||||
doc = ArangoDB.log_post("#{prefix}-create2", cmd1, :body => body)
|
||||
|
||||
doc.code.should eq(201)
|
||||
|
||||
|
||||
body = "{ \"a\" : [ 3, 4 ] }"
|
||||
doc = ArangoDB.log_post("#{prefix}-create2", cmd1, :body => body)
|
||||
|
||||
doc.code.should eq(201)
|
||||
|
||||
|
||||
body = "{ \"a\" : [ 5, 5 ] }"
|
||||
doc = ArangoDB.log_post("#{prefix}-create2", cmd1, :body => body)
|
||||
|
||||
|
@ -216,7 +216,7 @@ describe ArangoDB do
|
|||
|
||||
doc.code.should eq(409)
|
||||
end
|
||||
|
||||
|
||||
it "rolls back in case of violation" do
|
||||
cmd = "/_api/index?collection=#{@cn}"
|
||||
body = "{ \"type\" : \"hash\", \"unique\" : true, \"fields\" : [ \"a\" ] }"
|
||||
|
@ -225,7 +225,7 @@ describe ArangoDB do
|
|||
doc.code.should eq(201)
|
||||
doc.parsed_response['type'].should eq("hash")
|
||||
doc.parsed_response['unique'].should eq(true)
|
||||
|
||||
|
||||
# create a document
|
||||
cmd1 = "/_api/document?collection=#{@cn}"
|
||||
body = "{ \"a\" : 1, \"b\" : 1 }"
|
||||
|
@ -279,34 +279,39 @@ describe ArangoDB do
|
|||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
|
||||
# unload collection
|
||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
# unload collection
|
||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||
|
||||
doc.code.should eq(200)
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd3 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
doc = ArangoDB.get(cmd3)
|
||||
doc.code.should eq(200)
|
||||
sleep 1
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd3 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd3)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
# check it again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
end
|
||||
|
||||
# check it again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
end
|
||||
|
||||
it "rolls back in case of violation, sparse index" do
|
||||
|
@ -317,7 +322,7 @@ describe ArangoDB do
|
|||
doc.code.should eq(201)
|
||||
doc.parsed_response['type'].should eq("hash")
|
||||
doc.parsed_response['unique'].should eq(true)
|
||||
|
||||
|
||||
# create a document
|
||||
cmd1 = "/_api/document?collection=#{@cn}"
|
||||
body = "{ \"a\" : 1, \"b\" : 1 }"
|
||||
|
@ -371,42 +376,47 @@ describe ArangoDB do
|
|||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
|
||||
# unload collection
|
||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
# unload collection
|
||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||
|
||||
doc.code.should eq(200)
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd3 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
doc = ArangoDB.get(cmd3)
|
||||
doc.code.should eq(200)
|
||||
sleep 1
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd3 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd3)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
# check it again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
end
|
||||
|
||||
# check it again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
################################################################################
|
||||
## unique constraints during update
|
||||
################################################################################
|
||||
################################################################################
|
||||
## unique constraints during update
|
||||
################################################################################
|
||||
|
||||
context "updating documents:" do
|
||||
context "dealing with unique constraints:" do
|
||||
|
@ -415,11 +425,11 @@ describe ArangoDB do
|
|||
ArangoDB.drop_collection(@cn)
|
||||
@cid = ArangoDB.create_collection(@cn)
|
||||
end
|
||||
|
||||
|
||||
after do
|
||||
ArangoDB.drop_collection(@cn)
|
||||
end
|
||||
|
||||
|
||||
it "rolls back in case of violation" do
|
||||
cmd = "/_api/index?collection=#{@cn}"
|
||||
body = "{ \"type\" : \"hash\", \"unique\" : true, \"fields\" : [ \"a\" ] }"
|
||||
|
@ -428,7 +438,7 @@ describe ArangoDB do
|
|||
doc.code.should eq(201)
|
||||
doc.parsed_response['type'].should eq("hash")
|
||||
doc.parsed_response['unique'].should eq(true)
|
||||
|
||||
|
||||
# create a document
|
||||
cmd1 = "/_api/document?collection=#{@cn}"
|
||||
body = "{ \"a\" : 1, \"b\" : 1 }"
|
||||
|
@ -508,35 +518,40 @@ describe ArangoDB do
|
|||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
|
||||
# unload collection
|
||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
# unload collection
|
||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||
|
||||
doc.code.should eq(200)
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd4 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
doc = ArangoDB.get(cmd4)
|
||||
doc.code.should eq(200)
|
||||
sleep 1
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd4 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd4)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
# check the first document again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
end
|
||||
|
||||
# check the first document again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
end
|
||||
|
||||
it "rolls back in case of violation, sparse index" do
|
||||
|
@ -547,7 +562,7 @@ describe ArangoDB do
|
|||
doc.code.should eq(201)
|
||||
doc.parsed_response['type'].should eq("hash")
|
||||
doc.parsed_response['unique'].should eq(true)
|
||||
|
||||
|
||||
# create a document
|
||||
cmd1 = "/_api/document?collection=#{@cn}"
|
||||
body = "{ \"a\" : 1, \"b\" : 1 }"
|
||||
|
@ -627,35 +642,40 @@ describe ArangoDB do
|
|||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
|
||||
# unload collection
|
||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
# unload collection
|
||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||
|
||||
doc.code.should eq(200)
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd4 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
doc = ArangoDB.get(cmd4)
|
||||
doc.code.should eq(200)
|
||||
sleep 1
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd4 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd4)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
# check the first document again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
end
|
||||
|
||||
# check the first document again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -17,11 +17,11 @@ describe ArangoDB do
|
|||
ArangoDB.drop_collection(@cn)
|
||||
@cid = ArangoDB.create_collection(@cn)
|
||||
end
|
||||
|
||||
|
||||
after do
|
||||
ArangoDB.drop_collection(@cn)
|
||||
end
|
||||
|
||||
|
||||
it "does not create the index in case of violation" do
|
||||
# create a document
|
||||
cmd1 = "/_api/document?collection=#{@cn}"
|
||||
|
@ -133,11 +133,11 @@ describe ArangoDB do
|
|||
ArangoDB.drop_collection(@cn)
|
||||
@cid = ArangoDB.create_collection(@cn)
|
||||
end
|
||||
|
||||
|
||||
after do
|
||||
ArangoDB.drop_collection(@cn)
|
||||
end
|
||||
|
||||
|
||||
it "rolls back in case of violation" do
|
||||
cmd = "/_api/index?collection=#{@cn}"
|
||||
body = "{ \"type\" : \"persistent\", \"unique\" : true, \"fields\" : [ \"a\" ] }"
|
||||
|
@ -146,7 +146,7 @@ describe ArangoDB do
|
|||
doc.code.should eq(201)
|
||||
doc.parsed_response['type'].should eq("persistent")
|
||||
doc.parsed_response['unique'].should eq(true)
|
||||
|
||||
|
||||
# create a document
|
||||
cmd1 = "/_api/document?collection=#{@cn}"
|
||||
body = "{ \"a\" : 1, \"b\" : 1 }"
|
||||
|
@ -200,33 +200,38 @@ describe ArangoDB do
|
|||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
|
||||
# unload collection
|
||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd3 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
doc = ArangoDB.get(cmd3)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
# unload collection
|
||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
sleep 1
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd3 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd3)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
# check it again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
end
|
||||
|
||||
# check it again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
end
|
||||
|
||||
it "rolls back in case of violation, sparse index" do
|
||||
|
@ -237,7 +242,7 @@ describe ArangoDB do
|
|||
doc.code.should eq(201)
|
||||
doc.parsed_response['type'].should eq("persistent")
|
||||
doc.parsed_response['unique'].should eq(true)
|
||||
|
||||
|
||||
# create a document
|
||||
cmd1 = "/_api/document?collection=#{@cn}"
|
||||
body = "{ \"a\" : 1, \"b\" : 1 }"
|
||||
|
@ -291,33 +296,38 @@ describe ArangoDB do
|
|||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
|
||||
# unload collection
|
||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd3 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
doc = ArangoDB.get(cmd3)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
# unload collection
|
||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
sleep 1
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd3 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd3)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
# check it again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
end
|
||||
|
||||
# check it again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -333,11 +343,11 @@ describe ArangoDB do
|
|||
ArangoDB.drop_collection(@cn)
|
||||
@cid = ArangoDB.create_collection(@cn)
|
||||
end
|
||||
|
||||
|
||||
after do
|
||||
ArangoDB.drop_collection(@cn)
|
||||
end
|
||||
|
||||
|
||||
it "rolls back in case of violation" do
|
||||
cmd = "/_api/index?collection=#{@cn}"
|
||||
body = "{ \"type\" : \"persistent\", \"unique\" : true, \"fields\" : [ \"a\" ] }"
|
||||
|
@ -346,7 +356,7 @@ describe ArangoDB do
|
|||
doc.code.should eq(201)
|
||||
doc.parsed_response['type'].should eq("persistent")
|
||||
doc.parsed_response['unique'].should eq(true)
|
||||
|
||||
|
||||
# create a document
|
||||
cmd1 = "/_api/document?collection=#{@cn}"
|
||||
body = "{ \"a\" : 1, \"b\" : 1 }"
|
||||
|
@ -426,34 +436,39 @@ describe ArangoDB do
|
|||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
|
||||
# unload collection
|
||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd4 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
doc = ArangoDB.get(cmd4)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
# unload collection
|
||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
sleep 1
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd4 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd4)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
# check the first document again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
end
|
||||
|
||||
# check the first document again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
end
|
||||
|
||||
it "rolls back in case of violation, sparse index" do
|
||||
|
@ -464,7 +479,7 @@ describe ArangoDB do
|
|||
doc.code.should eq(201)
|
||||
doc.parsed_response['type'].should eq("persistent")
|
||||
doc.parsed_response['unique'].should eq(true)
|
||||
|
||||
|
||||
# create a document
|
||||
cmd1 = "/_api/document?collection=#{@cn}"
|
||||
body = "{ \"a\" : 1, \"b\" : 1 }"
|
||||
|
@ -544,34 +559,39 @@ describe ArangoDB do
|
|||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
|
||||
# unload collection
|
||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd4 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
doc = ArangoDB.get(cmd4)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
# unload collection
|
||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
sleep 1
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd4 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd4)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
# check the first document again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
end
|
||||
|
||||
# check the first document again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -200,33 +200,38 @@ describe ArangoDB do
|
|||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
|
||||
# unload collection
|
||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd3 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
doc = ArangoDB.get(cmd3)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
# unload collection
|
||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
sleep 1
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd3 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd3)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
# check it again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
end
|
||||
|
||||
# check it again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
end
|
||||
|
||||
it "rolls back in case of violation, sparse index" do
|
||||
|
@ -291,33 +296,38 @@ describe ArangoDB do
|
|||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
|
||||
# unload collection
|
||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd3 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
doc = ArangoDB.get(cmd3)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
# unload collection
|
||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
sleep 1
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd3 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd3)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
# check it again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
end
|
||||
|
||||
# check it again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -426,34 +436,39 @@ describe ArangoDB do
|
|||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
|
||||
# unload collection
|
||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd4 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
doc = ArangoDB.get(cmd4)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
# unload collection
|
||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
sleep 1
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd4 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd4)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
# check the first document again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
end
|
||||
|
||||
# check the first document again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
end
|
||||
|
||||
it "rolls back in case of violation, sparse index" do
|
||||
|
@ -544,34 +559,39 @@ describe ArangoDB do
|
|||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
|
||||
# unload collection
|
||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd4 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
doc = ArangoDB.get(cmd4)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
# unload collection
|
||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
sleep 1
|
||||
|
||||
# flush wal
|
||||
doc = ArangoDB.put("/_admin/wal/flush");
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd4 = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd4)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
# check the first document again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
end
|
||||
|
||||
# check the first document again
|
||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.parsed_response['a'].should eq(1)
|
||||
doc.parsed_response['b'].should eq(1)
|
||||
doc.parsed_response['_id'].should eq(id1)
|
||||
doc.parsed_response['_rev'].should eq(rev1)
|
||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -160,33 +160,39 @@ describe ArangoDB do
|
|||
|
||||
iid = doc.parsed_response['id']
|
||||
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
cmd = api + "/#{iid}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.headers['content-type'].should eq("application/json; charset=utf-8")
|
||||
doc.parsed_response['error'].should eq(false)
|
||||
doc.parsed_response['code'].should eq(200)
|
||||
doc.parsed_response['id'].should match(@reFull)
|
||||
doc.parsed_response['id'].should eq(iid)
|
||||
doc.parsed_response['type'].should eq("hash")
|
||||
doc.parsed_response['unique'].should eq(true)
|
||||
doc.parsed_response['sparse'].should eq(false)
|
||||
doc.parsed_response['fields'].should eq([ "a", "b" ])
|
||||
end
|
||||
|
||||
cmd = api + "/#{iid}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.headers['content-type'].should eq("application/json; charset=utf-8")
|
||||
doc.parsed_response['error'].should eq(false)
|
||||
doc.parsed_response['code'].should eq(200)
|
||||
doc.parsed_response['id'].should match(@reFull)
|
||||
doc.parsed_response['id'].should eq(iid)
|
||||
doc.parsed_response['type'].should eq("hash")
|
||||
doc.parsed_response['unique'].should eq(true)
|
||||
doc.parsed_response['sparse'].should eq(false)
|
||||
doc.parsed_response['fields'].should eq([ "a", "b" ])
|
||||
end
|
||||
|
||||
it "survives unload, sparse index" do
|
||||
|
@ -202,18 +208,25 @@ describe ArangoDB do
|
|||
|
||||
iid = doc.parsed_response['id']
|
||||
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
|
||||
end
|
||||
|
||||
cmd = api + "/#{iid}"
|
||||
|
@ -376,18 +389,24 @@ describe ArangoDB do
|
|||
|
||||
iid = doc.parsed_response['id']
|
||||
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
end
|
||||
|
||||
cmd = api + "/#{iid}"
|
||||
|
@ -418,18 +437,24 @@ describe ArangoDB do
|
|||
|
||||
iid = doc.parsed_response['id']
|
||||
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
end
|
||||
|
||||
cmd = api + "/#{iid}"
|
||||
|
@ -592,18 +617,24 @@ describe ArangoDB do
|
|||
|
||||
iid = doc.parsed_response['id']
|
||||
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
end
|
||||
|
||||
cmd = api + "/#{iid}"
|
||||
|
@ -634,18 +665,24 @@ describe ArangoDB do
|
|||
|
||||
iid = doc.parsed_response['id']
|
||||
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
end
|
||||
|
||||
cmd = api + "/#{iid}"
|
||||
|
@ -774,18 +811,24 @@ describe ArangoDB do
|
|||
|
||||
iid = doc.parsed_response['id']
|
||||
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
end
|
||||
|
||||
cmd = api + "/#{iid}"
|
||||
|
@ -816,18 +859,24 @@ describe ArangoDB do
|
|||
|
||||
iid = doc.parsed_response['id']
|
||||
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||
cmd = "/_api/collection/#{@cn}/unload"
|
||||
doc = ArangoDB.put(cmd)
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.code.should eq(200)
|
||||
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
while doc.parsed_response['status'] != 2
|
||||
cmd = "/_api/collection/#{@cn}"
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
|
||||
i = 0
|
||||
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||
doc = ArangoDB.get(cmd)
|
||||
doc.code.should eq(200)
|
||||
i += 1
|
||||
sleep 1
|
||||
end
|
||||
expect(i).to be < 100 # Timeout...
|
||||
end
|
||||
|
||||
cmd = api + "/#{iid}"
|
||||
|
|
Loading…
Reference in New Issue