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.ARANGO_PASSWORD = "' + options.password + '"\n' +
|
||||||
' c.add_setting :SKIP_TIMECRITICAL\n' +
|
' c.add_setting :SKIP_TIMECRITICAL\n' +
|
||||||
' c.SKIP_TIMECRITICAL = ' + JSON.stringify(options.skipTimeCritical) + '\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';
|
'end\n';
|
||||||
|
|
||||||
fs.write(tmpname, rspecConfig);
|
fs.write(tmpname, rspecConfig);
|
||||||
|
|
|
@ -194,6 +194,7 @@ describe ArangoDB do
|
||||||
|
|
||||||
iid = doc.parsed_response['id']
|
iid = doc.parsed_response['id']
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
cmd = "/_api/collection/#{@cn}/unload"
|
cmd = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.put(cmd)
|
doc = ArangoDB.put(cmd)
|
||||||
|
|
||||||
|
@ -203,11 +204,15 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
|
sleep 1
|
||||||
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
end
|
end
|
||||||
|
|
||||||
cmd = api + "/#{iid}"
|
cmd = api + "/#{iid}"
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@ require 'arangodb.rb'
|
||||||
describe ArangoDB do
|
describe ArangoDB do
|
||||||
prefix = "api-index-hash"
|
prefix = "api-index-hash"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
## unique constraints during create
|
## unique constraints during create
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
context "creating hash index:" do
|
context "creating hash index:" do
|
||||||
context "dealing with unique constraints violation:" do
|
context "dealing with unique constraints violation:" do
|
||||||
|
@ -126,9 +126,9 @@ describe ArangoDB do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
## unique constraints during create
|
## unique constraints during create
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
context "creating documents:" do
|
context "creating documents:" do
|
||||||
context "dealing with unique constraints:" do
|
context "dealing with unique constraints:" do
|
||||||
|
@ -279,6 +279,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_id'].should eq(id1)
|
doc.parsed_response['_id'].should eq(id1)
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
# unload collection
|
# unload collection
|
||||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||||
|
@ -293,11 +294,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd3)
|
doc = ArangoDB.get(cmd3)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
# check it again
|
# check it again
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||||
|
@ -308,6 +312,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_id'].should eq(id1)
|
doc.parsed_response['_id'].should eq(id1)
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it "rolls back in case of violation, sparse index" do
|
it "rolls back in case of violation, sparse index" do
|
||||||
cmd = "/_api/index?collection=#{@cn}"
|
cmd = "/_api/index?collection=#{@cn}"
|
||||||
|
@ -371,6 +376,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_id'].should eq(id1)
|
doc.parsed_response['_id'].should eq(id1)
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
# unload collection
|
# unload collection
|
||||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||||
|
@ -385,11 +391,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd3)
|
doc = ArangoDB.get(cmd3)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
# check it again
|
# check it again
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||||
|
@ -400,13 +409,14 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_id'].should eq(id1)
|
doc.parsed_response['_id'].should eq(id1)
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
## unique constraints during update
|
## unique constraints during update
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
context "updating documents:" do
|
context "updating documents:" do
|
||||||
context "dealing with unique constraints:" do
|
context "dealing with unique constraints:" do
|
||||||
|
@ -508,6 +518,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
# unload collection
|
# unload collection
|
||||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||||
|
@ -522,11 +533,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd4)
|
doc = ArangoDB.get(cmd4)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
# check the first document again
|
# check the first document again
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||||
|
@ -538,6 +552,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it "rolls back in case of violation, sparse index" do
|
it "rolls back in case of violation, sparse index" do
|
||||||
cmd = "/_api/index?collection=#{@cn}"
|
cmd = "/_api/index?collection=#{@cn}"
|
||||||
|
@ -627,6 +642,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
# unload collection
|
# unload collection
|
||||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||||
|
@ -641,11 +657,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd4)
|
doc = ArangoDB.get(cmd4)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
# check the first document again
|
# check the first document again
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||||
|
@ -658,6 +677,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -200,6 +200,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_id'].should eq(id1)
|
doc.parsed_response['_id'].should eq(id1)
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
# unload collection
|
# unload collection
|
||||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||||
|
@ -213,11 +214,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd3)
|
doc = ArangoDB.get(cmd3)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
# check it again
|
# check it again
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||||
|
@ -228,6 +232,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_id'].should eq(id1)
|
doc.parsed_response['_id'].should eq(id1)
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it "rolls back in case of violation, sparse index" do
|
it "rolls back in case of violation, sparse index" do
|
||||||
cmd = "/_api/index?collection=#{@cn}"
|
cmd = "/_api/index?collection=#{@cn}"
|
||||||
|
@ -291,6 +296,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_id'].should eq(id1)
|
doc.parsed_response['_id'].should eq(id1)
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
# unload collection
|
# unload collection
|
||||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||||
|
@ -304,11 +310,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd3)
|
doc = ArangoDB.get(cmd3)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
# check it again
|
# check it again
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||||
|
@ -321,6 +330,7 @@ describe ArangoDB do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
## unique constraints during update
|
## unique constraints during update
|
||||||
|
@ -426,6 +436,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
# unload collection
|
# unload collection
|
||||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||||
|
@ -439,11 +450,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd4)
|
doc = ArangoDB.get(cmd4)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
# check the first document again
|
# check the first document again
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||||
|
@ -455,6 +469,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it "rolls back in case of violation, sparse index" do
|
it "rolls back in case of violation, sparse index" do
|
||||||
cmd = "/_api/index?collection=#{@cn}"
|
cmd = "/_api/index?collection=#{@cn}"
|
||||||
|
@ -544,6 +559,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
# unload collection
|
# unload collection
|
||||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||||
|
@ -557,11 +573,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd4)
|
doc = ArangoDB.get(cmd4)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
# check the first document again
|
# check the first document again
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||||
|
@ -574,6 +593,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -200,6 +200,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_id'].should eq(id1)
|
doc.parsed_response['_id'].should eq(id1)
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
# unload collection
|
# unload collection
|
||||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||||
|
@ -213,11 +214,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd3)
|
doc = ArangoDB.get(cmd3)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
# check it again
|
# check it again
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||||
|
@ -228,6 +232,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_id'].should eq(id1)
|
doc.parsed_response['_id'].should eq(id1)
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it "rolls back in case of violation, sparse index" do
|
it "rolls back in case of violation, sparse index" do
|
||||||
cmd = "/_api/index?collection=#{@cn}"
|
cmd = "/_api/index?collection=#{@cn}"
|
||||||
|
@ -291,6 +296,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_id'].should eq(id1)
|
doc.parsed_response['_id'].should eq(id1)
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
# unload collection
|
# unload collection
|
||||||
cmd3 = "/_api/collection/#{@cn}/unload"
|
cmd3 = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
doc = ArangoDB.log_put("#{prefix}", cmd3)
|
||||||
|
@ -304,11 +310,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
doc = ArangoDB.log_get("#{prefix}", cmd3)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd3)
|
doc = ArangoDB.get(cmd3)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
# check it again
|
# check it again
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||||
|
@ -321,6 +330,7 @@ describe ArangoDB do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
## unique constraints during update
|
## unique constraints during update
|
||||||
|
@ -426,6 +436,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
# unload collection
|
# unload collection
|
||||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||||
|
@ -439,11 +450,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd4)
|
doc = ArangoDB.get(cmd4)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
# check the first document again
|
# check the first document again
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||||
|
@ -455,6 +469,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it "rolls back in case of violation, sparse index" do
|
it "rolls back in case of violation, sparse index" do
|
||||||
cmd = "/_api/index?collection=#{@cn}"
|
cmd = "/_api/index?collection=#{@cn}"
|
||||||
|
@ -544,6 +559,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_rev'].should eq(rev1)
|
doc.parsed_response['_rev'].should eq(rev1)
|
||||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
# unload collection
|
# unload collection
|
||||||
cmd4 = "/_api/collection/#{@cn}/unload"
|
cmd4 = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
doc = ArangoDB.log_put("#{prefix}", cmd4)
|
||||||
|
@ -557,11 +573,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
doc = ArangoDB.log_get("#{prefix}", cmd4)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd4)
|
doc = ArangoDB.get(cmd4)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
# check the first document again
|
# check the first document again
|
||||||
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
doc = ArangoDB.log_get("#{prefix}", cmd2)
|
||||||
|
@ -574,6 +593,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['_rev'].should_not eq(rev2)
|
doc.parsed_response['_rev'].should_not eq(rev2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -160,6 +160,7 @@ describe ArangoDB do
|
||||||
|
|
||||||
iid = doc.parsed_response['id']
|
iid = doc.parsed_response['id']
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
cmd = "/_api/collection/#{@cn}/unload"
|
cmd = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.put(cmd)
|
doc = ArangoDB.put(cmd)
|
||||||
|
|
||||||
|
@ -169,10 +170,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
|
sleep 1
|
||||||
end
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
cmd = api + "/#{iid}"
|
cmd = api + "/#{iid}"
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
|
@ -188,6 +193,7 @@ describe ArangoDB do
|
||||||
doc.parsed_response['sparse'].should eq(false)
|
doc.parsed_response['sparse'].should eq(false)
|
||||||
doc.parsed_response['fields'].should eq([ "a", "b" ])
|
doc.parsed_response['fields'].should eq([ "a", "b" ])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it "survives unload, sparse index" do
|
it "survives unload, sparse index" do
|
||||||
cmd = api + "?collection=#{@cn}"
|
cmd = api + "?collection=#{@cn}"
|
||||||
|
@ -202,6 +208,7 @@ describe ArangoDB do
|
||||||
|
|
||||||
iid = doc.parsed_response['id']
|
iid = doc.parsed_response['id']
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
cmd = "/_api/collection/#{@cn}/unload"
|
cmd = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.put(cmd)
|
doc = ArangoDB.put(cmd)
|
||||||
|
|
||||||
|
@ -211,9 +218,15 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
|
sleep 1
|
||||||
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
cmd = api + "/#{iid}"
|
cmd = api + "/#{iid}"
|
||||||
|
@ -376,6 +389,7 @@ describe ArangoDB do
|
||||||
|
|
||||||
iid = doc.parsed_response['id']
|
iid = doc.parsed_response['id']
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
cmd = "/_api/collection/#{@cn}/unload"
|
cmd = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.put(cmd)
|
doc = ArangoDB.put(cmd)
|
||||||
|
|
||||||
|
@ -385,9 +399,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
|
sleep 1
|
||||||
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
end
|
end
|
||||||
|
|
||||||
cmd = api + "/#{iid}"
|
cmd = api + "/#{iid}"
|
||||||
|
@ -418,6 +437,7 @@ describe ArangoDB do
|
||||||
|
|
||||||
iid = doc.parsed_response['id']
|
iid = doc.parsed_response['id']
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
cmd = "/_api/collection/#{@cn}/unload"
|
cmd = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.put(cmd)
|
doc = ArangoDB.put(cmd)
|
||||||
|
|
||||||
|
@ -427,9 +447,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
|
sleep 1
|
||||||
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
end
|
end
|
||||||
|
|
||||||
cmd = api + "/#{iid}"
|
cmd = api + "/#{iid}"
|
||||||
|
@ -592,6 +617,7 @@ describe ArangoDB do
|
||||||
|
|
||||||
iid = doc.parsed_response['id']
|
iid = doc.parsed_response['id']
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
cmd = "/_api/collection/#{@cn}/unload"
|
cmd = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.put(cmd)
|
doc = ArangoDB.put(cmd)
|
||||||
|
|
||||||
|
@ -601,9 +627,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
|
sleep 1
|
||||||
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
end
|
end
|
||||||
|
|
||||||
cmd = api + "/#{iid}"
|
cmd = api + "/#{iid}"
|
||||||
|
@ -634,6 +665,7 @@ describe ArangoDB do
|
||||||
|
|
||||||
iid = doc.parsed_response['id']
|
iid = doc.parsed_response['id']
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
cmd = "/_api/collection/#{@cn}/unload"
|
cmd = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.put(cmd)
|
doc = ArangoDB.put(cmd)
|
||||||
|
|
||||||
|
@ -643,9 +675,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
|
sleep 1
|
||||||
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
end
|
end
|
||||||
|
|
||||||
cmd = api + "/#{iid}"
|
cmd = api + "/#{iid}"
|
||||||
|
@ -774,6 +811,7 @@ describe ArangoDB do
|
||||||
|
|
||||||
iid = doc.parsed_response['id']
|
iid = doc.parsed_response['id']
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
cmd = "/_api/collection/#{@cn}/unload"
|
cmd = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.put(cmd)
|
doc = ArangoDB.put(cmd)
|
||||||
|
|
||||||
|
@ -783,9 +821,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
|
sleep 1
|
||||||
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
end
|
end
|
||||||
|
|
||||||
cmd = api + "/#{iid}"
|
cmd = api + "/#{iid}"
|
||||||
|
@ -816,6 +859,7 @@ describe ArangoDB do
|
||||||
|
|
||||||
iid = doc.parsed_response['id']
|
iid = doc.parsed_response['id']
|
||||||
|
|
||||||
|
if RSpec.configuration.STORAGE_ENGINE == "mmfiles"
|
||||||
cmd = "/_api/collection/#{@cn}/unload"
|
cmd = "/_api/collection/#{@cn}/unload"
|
||||||
doc = ArangoDB.put(cmd)
|
doc = ArangoDB.put(cmd)
|
||||||
|
|
||||||
|
@ -825,9 +869,14 @@ describe ArangoDB do
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
|
||||||
while doc.parsed_response['status'] != 2
|
i = 0
|
||||||
|
while (doc.parsed_response['status'] != 2) && (i < 100)
|
||||||
doc = ArangoDB.get(cmd)
|
doc = ArangoDB.get(cmd)
|
||||||
doc.code.should eq(200)
|
doc.code.should eq(200)
|
||||||
|
i += 1
|
||||||
|
sleep 1
|
||||||
|
end
|
||||||
|
expect(i).to be < 100 # Timeout...
|
||||||
end
|
end
|
||||||
|
|
||||||
cmd = api + "/#{iid}"
|
cmd = api + "/#{iid}"
|
||||||
|
|
Loading…
Reference in New Issue