1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into engine-api

This commit is contained in:
jsteemann 2017-01-26 16:25:22 +01:00
commit df7fee7d32
10 changed files with 118 additions and 118 deletions

View File

@ -259,111 +259,113 @@ describe ArangoDB do
doc.parsed_response['isSystem'].should eq(false) doc.parsed_response['isSystem'].should eq(false)
doc.parsed_response['journalSize'].should be_kind_of(Integer) doc.parsed_response['journalSize'].should be_kind_of(Integer)
end end
describe "figures", :timecritical => true do
# get figures
it "extracting the figures for a collection" do
# flush wal
ArangoDB.put("/_admin/wal/flush?waitForSync=true&waitForCollector=true", { })
sleep 3
# get figures cmd = api + "/" + @cn + "/figures"
it "extracting the figures for a collection" do doc = ArangoDB.log_get("#{prefix}-get-collection-figures", cmd)
# flush wal
ArangoDB.put("/_admin/wal/flush?waitForSync=true&waitForCollector=true", { })
sleep 3
cmd = api + "/" + @cn + "/figures" doc.code.should eq(200)
doc = ArangoDB.log_get("#{prefix}-get-collection-figures", cmd) 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 eq(@cid)
doc.parsed_response['name'].should eq(@cn)
doc.parsed_response['status'].should eq(3)
doc.parsed_response['count'].should be_kind_of(Integer)
doc.parsed_response['count'].should eq(0)
doc.parsed_response['figures']['dead']['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['dead']['count'].should eq(0)
doc.parsed_response['figures']['alive']['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['alive']['count'].should eq(0)
doc.parsed_response['figures']['datafiles']['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['datafiles']['fileSize'].should be_kind_of(Integer)
doc.parsed_response['figures']['datafiles']['count'].should eq(0)
doc.parsed_response['figures']['journals']['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['journals']['fileSize'].should be_kind_of(Integer)
doc.parsed_response['figures']['journals']['count'].should eq(0)
doc.parsed_response['figures']['compactors']['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['compactors']['fileSize'].should be_kind_of(Integer)
doc.parsed_response['figures']['compactors']['count'].should eq(0)
doc.parsed_response['journalSize'].should be_kind_of(Integer)
# create a few documents, this should increase counts
(0...10).each{|i|
body = "{ \"test\" : " + i.to_s + " }"
doc = ArangoDB.log_post("#{prefix}-get-collection-figures", "/_api/document/?collection=" + @cn, :body => body)
}
doc.code.should eq(200) # flush wal
doc.headers['content-type'].should eq("application/json; charset=utf-8") ArangoDB.put("/_admin/wal/flush?waitForSync=true&waitForCollector=true", { })
doc.parsed_response['error'].should eq(false) sleep 6
doc.parsed_response['code'].should eq(200)
doc.parsed_response['id'].should eq(@cid) doc = ArangoDB.log_get("#{prefix}-get-collection-figures", cmd)
doc.parsed_response['name'].should eq(@cn) doc.code.should eq(200)
doc.parsed_response['status'].should eq(3) doc.headers['content-type'].should eq("application/json; charset=utf-8")
doc.parsed_response['count'].should be_kind_of(Integer) doc.parsed_response['error'].should eq(false)
doc.parsed_response['count'].should eq(0) doc.parsed_response['code'].should eq(200)
doc.parsed_response['figures']['dead']['count'].should be_kind_of(Integer) doc.parsed_response['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['dead']['count'].should eq(0) doc.parsed_response['count'].should eq(10)
doc.parsed_response['figures']['alive']['count'].should be_kind_of(Integer) doc.parsed_response['figures']['dead']['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['alive']['count'].should eq(0) doc.parsed_response['figures']['dead']['count'].should eq(0)
doc.parsed_response['figures']['datafiles']['count'].should be_kind_of(Integer) doc.parsed_response['figures']['alive']['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['datafiles']['fileSize'].should be_kind_of(Integer) doc.parsed_response['figures']['alive']['count'].should eq(10)
doc.parsed_response['figures']['datafiles']['count'].should eq(0) doc.parsed_response['figures']['datafiles']['count'].should eq(0)
doc.parsed_response['figures']['journals']['count'].should be_kind_of(Integer) doc.parsed_response['figures']['journals']['count'].should eq(1)
doc.parsed_response['figures']['journals']['fileSize'].should be_kind_of(Integer)
doc.parsed_response['figures']['journals']['count'].should eq(0)
doc.parsed_response['figures']['compactors']['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['compactors']['fileSize'].should be_kind_of(Integer)
doc.parsed_response['figures']['compactors']['count'].should eq(0)
doc.parsed_response['journalSize'].should be_kind_of(Integer)
# create a few documents, this should increase counts
(0...10).each{|i|
body = "{ \"test\" : " + i.to_s + " }"
doc = ArangoDB.log_post("#{prefix}-get-collection-figures", "/_api/document/?collection=" + @cn, :body => body)
}
# flush wal # create a few different documents, this should increase counts
ArangoDB.put("/_admin/wal/flush?waitForSync=true&waitForCollector=true", { }) (0...10).each{|i|
sleep 6 body = "{ \"test" + i.to_s + "\" : 1 }"
doc = ArangoDB.log_post("#{prefix}-get-collection-figures", "/_api/document/?collection=" + @cn, :body => body)
doc = ArangoDB.log_get("#{prefix}-get-collection-figures", cmd) }
doc.code.should eq(200)
doc.headers['content-type'].should eq("application/json; charset=utf-8") # flush wal
doc.parsed_response['error'].should eq(false) ArangoDB.put("/_admin/wal/flush?waitForSync=true&waitForCollector=true", { })
doc.parsed_response['code'].should eq(200) sleep 6
doc.parsed_response['count'].should be_kind_of(Integer)
doc.parsed_response['count'].should eq(10) doc = ArangoDB.log_get("#{prefix}-get-collection-figures", cmd)
doc.parsed_response['figures']['dead']['count'].should be_kind_of(Integer) doc.code.should eq(200)
doc.parsed_response['figures']['dead']['count'].should eq(0) doc.headers['content-type'].should eq("application/json; charset=utf-8")
doc.parsed_response['figures']['alive']['count'].should be_kind_of(Integer) doc.parsed_response['error'].should eq(false)
doc.parsed_response['figures']['alive']['count'].should eq(10) doc.parsed_response['code'].should eq(200)
doc.parsed_response['figures']['datafiles']['count'].should eq(0) doc.parsed_response['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['journals']['count'].should eq(1) doc.parsed_response['count'].should eq(20)
doc.parsed_response['figures']['dead']['count'].should be_kind_of(Integer)
# create a few different documents, this should increase counts doc.parsed_response['figures']['dead']['count'].should eq(0)
(0...10).each{|i| doc.parsed_response['figures']['alive']['count'].should be_kind_of(Integer)
body = "{ \"test" + i.to_s + "\" : 1 }" doc.parsed_response['figures']['alive']['count'].should eq(20)
doc = ArangoDB.log_post("#{prefix}-get-collection-figures", "/_api/document/?collection=" + @cn, :body => body) doc.parsed_response['figures']['datafiles']['count'].should eq(0)
} doc.parsed_response['figures']['journals']['count'].should eq(1)
# flush wal # delete a few documents, this should change counts
ArangoDB.put("/_admin/wal/flush?waitForSync=true&waitForCollector=true", { }) body = "{ \"collection\" : \"" + @cn + "\", \"example\": { \"test\" : 5 } }"
sleep 6 doc = ArangoDB.log_put("#{prefix}-get-collection-figures", "/_api/simple/remove-by-example", :body => body)
body = "{ \"collection\" : \"" + @cn + "\", \"example\": { \"test3\" : 1 } }"
doc = ArangoDB.log_get("#{prefix}-get-collection-figures", cmd) doc = ArangoDB.log_put("#{prefix}-get-collection-figures", "/_api/simple/remove-by-example", :body => body)
doc.code.should eq(200)
doc.headers['content-type'].should eq("application/json; charset=utf-8") # flush wal
doc.parsed_response['error'].should eq(false) ArangoDB.put("/_admin/wal/flush?waitForSync=true&waitForCollector=true", { })
doc.parsed_response['code'].should eq(200) sleep 3
doc.parsed_response['count'].should be_kind_of(Integer)
doc.parsed_response['count'].should eq(20) doc = ArangoDB.log_get("#{prefix}-get-collection-figures", cmd)
doc.parsed_response['figures']['dead']['count'].should be_kind_of(Integer) doc.code.should eq(200)
doc.parsed_response['figures']['dead']['count'].should eq(0) doc.headers['content-type'].should eq("application/json; charset=utf-8")
doc.parsed_response['figures']['alive']['count'].should be_kind_of(Integer) doc.parsed_response['error'].should eq(false)
doc.parsed_response['figures']['alive']['count'].should eq(20) doc.parsed_response['code'].should eq(200)
doc.parsed_response['figures']['datafiles']['count'].should eq(0) doc.parsed_response['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['journals']['count'].should eq(1) doc.parsed_response['count'].should eq(18)
doc.parsed_response['figures']['dead']['count'].should be_kind_of(Integer)
# delete a few documents, this should change counts doc.parsed_response['figures']['dead']['count'].should eq(2)
body = "{ \"collection\" : \"" + @cn + "\", \"example\": { \"test\" : 5 } }" doc.parsed_response['figures']['alive']['count'].should be_kind_of(Integer)
doc = ArangoDB.log_put("#{prefix}-get-collection-figures", "/_api/simple/remove-by-example", :body => body) doc.parsed_response['figures']['alive']['count'].should eq(18)
body = "{ \"collection\" : \"" + @cn + "\", \"example\": { \"test3\" : 1 } }" doc.parsed_response['figures']['datafiles']['count'].should eq(0)
doc = ArangoDB.log_put("#{prefix}-get-collection-figures", "/_api/simple/remove-by-example", :body => body) doc.parsed_response['figures']['journals']['count'].should eq(1)
end
# flush wal
ArangoDB.put("/_admin/wal/flush?waitForSync=true&waitForCollector=true", { })
sleep 3
doc = ArangoDB.log_get("#{prefix}-get-collection-figures", 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['count'].should be_kind_of(Integer)
doc.parsed_response['count'].should eq(18)
doc.parsed_response['figures']['dead']['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['dead']['count'].should eq(2)
doc.parsed_response['figures']['alive']['count'].should be_kind_of(Integer)
doc.parsed_response['figures']['alive']['count'].should eq(18)
doc.parsed_response['figures']['datafiles']['count'].should eq(0)
doc.parsed_response['figures']['journals']['count'].should eq(1)
end end
# get revision id # get revision id

View File

@ -12,6 +12,7 @@ $user = ENV['ARANGO_USER']
$password = ENV['ARANGO_PASSWORD'] $password = ENV['ARANGO_PASSWORD']
$ssl = ENV['ARANGO_SSL'] $ssl = ENV['ARANGO_SSL']
$silent = ENV['ARANGO_NO_LOG'] || '' $silent = ENV['ARANGO_NO_LOG'] || ''
$skip_timecritical = ENV['SKIP_TIMECRITICAL'] || true
begin begin
$address = RSpec.configuration.ARANGO_SERVER $address = RSpec.configuration.ARANGO_SERVER
@ -29,6 +30,10 @@ begin
$ssl = RSpec.configuration.ARANGO_SSL $ssl = RSpec.configuration.ARANGO_SSL
rescue rescue
end end
begin
$skip_timecritical = RSpec.configuration.SKIP_TIMECRITICAL
rescue
end
RSpec.configure do |config| RSpec.configure do |config|
config.expect_with :rspec do |c| config.expect_with :rspec do |c|
@ -41,6 +46,9 @@ RSpec.configure do |config|
if $ssl == '1' if $ssl == '1'
config.filter_run_excluding :ssl => true config.filter_run_excluding :ssl => true
end end
if $skip_timecritical
config.filter_run_excluding :timecritical => true
end
end end
################################################################################ ################################################################################

View File

@ -943,18 +943,6 @@ void Agent::beginShutdown() {
_spearhead.beginShutdown(); _spearhead.beginShutdown();
_readDB.beginShutdown(); _readDB.beginShutdown();
if (size() > 1 && _inception != nullptr) {
int counter = 0;
while (_inception->isRunning()) {
usleep(100000);
// emit warning after 5 seconds
if (++counter == 10 * 5) {
LOG_TOPIC(WARN, Logger::AGENCY)
<< "waiting for inception thread to finish";
}
}
}
// Wake up all waiting rest handlers // Wake up all waiting rest handlers
{ {
CONDITION_LOCKER(guardW, _waitForCV); CONDITION_LOCKER(guardW, _waitForCV);

File diff suppressed because one or more lines are too long

View File

@ -2742,4 +2742,4 @@ var cutByResolution = function (str) {
</div> </div>
<div id="workMonitorContent" class="innerContent"> <div id="workMonitorContent" class="innerContent">
</div></script></head><body><nav class="navbar" style="display: none"><div class="primary"><div class="navlogo"><a class="logo big" href="#"><img id="ArangoDBLogo" class="arangodbLogo" src="img/arangodb-edition-optimized.svg"></a><a class="logo small" href="#"><img class="arangodbLogo" src="img/arangodb_logo_small.png"></a><a class="version"><span id="currentVersion"></span></a></div><div class="statmenu" id="statisticBar"></div><div class="navmenu" id="navigationBar"></div></div></nav><div id="modalPlaceholder"></div><div class="bodyWrapper" style="display: none"><div class="centralRow"><div id="navbar2" class="navbarWrapper secondary"><div class="subnavmenu" id="subNavigationBar"></div></div><div class="resizecontainer contentWrapper"><div id="loadingScreen" class="loadingScreen" style="display: none"><i class="fa fa-circle-o-notch fa-spin fa-3x fa-fw margin-bottom"></i> <span class="sr-only">Loading...</span></div><div id="content" class="centralContent"></div><footer class="footer"><div id="footerBar"></div></footer></div></div></div><div id="progressPlaceholder" style="display:none"></div><div id="spotlightPlaceholder" style="display:none"></div><div id="graphSettingsContent" style="display: none"></div><div id="offlinePlaceholder" style="display:none"><div class="offline-div"><div class="pure-u"><div class="pure-u-1-4"></div><div class="pure-u-1-2 offline-window"><div class="offline-header"><h3>You have been disconnected from the server</h3></div><div class="offline-body"><p>The connection to the server has been lost. The server may be under heavy load.</p><p>Trying to reconnect in <span id="offlineSeconds">10</span> seconds.</p><p class="animation_state"><span><button class="button-success">Reconnect now</button></span></p></div></div><div class="pure-u-1-4"></div></div></div></div><div class="arangoFrame" style=""><div class="outerDiv"><div class="innerDiv"></div></div></div><script src="libs.js?version=1484747756272"></script><script src="app.js?version=1484747756272"></script></body></html> </div></script></head><body><nav class="navbar" style="display: none"><div class="primary"><div class="navlogo"><a class="logo big" href="#"><img id="ArangoDBLogo" class="arangodbLogo" src="img/arangodb-edition-optimized.svg"></a><a class="logo small" href="#"><img class="arangodbLogo" src="img/arangodb_logo_small.png"></a><a class="version"><span id="currentVersion"></span></a></div><div class="statmenu" id="statisticBar"></div><div class="navmenu" id="navigationBar"></div></div></nav><div id="modalPlaceholder"></div><div class="bodyWrapper" style="display: none"><div class="centralRow"><div id="navbar2" class="navbarWrapper secondary"><div class="subnavmenu" id="subNavigationBar"></div></div><div class="resizecontainer contentWrapper"><div id="loadingScreen" class="loadingScreen" style="display: none"><i class="fa fa-circle-o-notch fa-spin fa-3x fa-fw margin-bottom"></i> <span class="sr-only">Loading...</span></div><div id="content" class="centralContent"></div><footer class="footer"><div id="footerBar"></div></footer></div></div></div><div id="progressPlaceholder" style="display:none"></div><div id="spotlightPlaceholder" style="display:none"></div><div id="graphSettingsContent" style="display: none"></div><div id="offlinePlaceholder" style="display:none"><div class="offline-div"><div class="pure-u"><div class="pure-u-1-4"></div><div class="pure-u-1-2 offline-window"><div class="offline-header"><h3>You have been disconnected from the server</h3></div><div class="offline-body"><p>The connection to the server has been lost. The server may be under heavy load.</p><p>Trying to reconnect in <span id="offlineSeconds">10</span> seconds.</p><p class="animation_state"><span><button class="button-success">Reconnect now</button></span></p></div></div><div class="pure-u-1-4"></div></div></div></div><div class="arangoFrame" style=""><div class="outerDiv"><div class="innerDiv"></div></div></div><script src="libs.js?version=1485441311283"></script><script src="app.js?version=1485441311283"></script></body></html>

View File

@ -109,7 +109,7 @@
self.dbServers[0].each(function (db) { self.dbServers[0].each(function (db) {
if (db.get('name') !== fromServer) { if (db.get('name') !== fromServer) {
obj[db.get('name')] = { obj[db.get('name')] = {
value: db.get('name'), value: db.get('id'),
label: db.get('name') label: db.get('name')
}; };
} }

View File

@ -1644,8 +1644,9 @@ function rubyTests (options, ssl) {
' c.ARANGO_USER = "' + options.username + '"\n' + ' c.ARANGO_USER = "' + options.username + '"\n' +
' c.add_setting :ARANGO_PASSWORD\n' + ' c.add_setting :ARANGO_PASSWORD\n' +
' c.ARANGO_PASSWORD = "' + options.password + '"\n' + ' c.ARANGO_PASSWORD = "' + options.password + '"\n' +
' c.add_setting :SKIP_TIMECRITICAL\n' +
' c.SKIP_TIMECRITICAL = ' + JSON.stringify(options.skipTimeCritical) + '\n' +
'end\n'); 'end\n');
try { try {
fs.makeDirectory(LOGS_DIR); fs.makeDirectory(LOGS_DIR);
} catch (err) {} } catch (err) {}

View File

@ -155,7 +155,8 @@ function MovingShardsSuite () {
obj = getCleanedOutServers(); obj = getCleanedOutServers();
if (obj.cleanedServers.indexOf(id) >= 0) { if (obj.cleanedServers.indexOf(id) >= 0) {
ok = true; ok = true;
console.info("Success: Server " + id + " cleaned out."); console.info(
"Success: Server " + id + " cleaned out after " + (300-count) + " seconds");
break; break;
} }
wait(1.0); wait(1.0);