1
0
Fork 0

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

This commit is contained in:
jsteemann 2017-04-03 17:26:39 +02:00
commit ad3f1074fe
5 changed files with 14 additions and 140 deletions

View File

@ -256,11 +256,11 @@ int main(int argc, char* argv[]) {
ARGV = argv;
SERVICE_TABLE_ENTRY ste[] = {
{TEXT(""), (LPSERVICE_MAIN_FUNCTION)ServiceMain}, {nullptr, nullptr}};
{TEXT(""), (LPSERVICE_MAIN_FUNCTION)ServiceMain}, {nullptr, nullptr}};
if (!StartServiceCtrlDispatcher(ste)) {
std::cerr << "FATAL: StartServiceCtrlDispatcher has failed with "
<< GetLastError() << std::endl;
<< GetLastError() << std::endl;
exit(EXIT_FAILURE);
}
} else

View File

@ -589,8 +589,6 @@ int RestoreFeature::processInputDirectory(std::string& errorMsg) {
length = found - buffer.begin();
}
TRI_ASSERT(length > 0);
_stats._totalBatches++;
int res =

View File

@ -49,7 +49,8 @@ ClientFeature::ClientFeature(application_features::ApplicationServer* server,
_maxPacketSize(128 * 1024 * 1024),
_sslProtocol(4),
_retries(DEFAULT_RETRIES),
_warn(false) {
_warn(false),
_haveServerPassword(false){
setOptional(true);
requiresElevatedPrivileges(false);
startsAfter("Logger");
@ -135,9 +136,16 @@ void ClientFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
FATAL_ERROR_EXIT();
}
_haveServerPassword = !options->processingResult().touched("server.password");
SimpleHttpClient::setMaxPacketSize(_maxPacketSize);
}
void ClientFeature::prepare() {
// ask for a password
if (_authentication &&
!options->processingResult().touched("server.password")) {
isEnabled() &&
_haveServerPassword) {
usleep(10 * 1000);
try {
@ -155,8 +163,6 @@ void ClientFeature::validateOptions(std::shared_ptr<ProgramOptions> options) {
_password = ConsoleFeature::readPassword();
std::cout << std::endl << std::flush;
}
SimpleHttpClient::setMaxPacketSize(_maxPacketSize);
}
std::unique_ptr<GeneralClientConnection> ClientFeature::createConnection() {

View File

@ -50,6 +50,7 @@ class ClientFeature final : public application_features::ApplicationFeature,
public:
void collectOptions(std::shared_ptr<options::ProgramOptions>) override final;
void validateOptions(std::shared_ptr<options::ProgramOptions>) override final;
void prepare() override final;
public:
std::string const& databaseName() const { return _databaseName; }
@ -99,6 +100,7 @@ class ClientFeature final : public application_features::ApplicationFeature,
private:
size_t _retries;
bool _warn;
bool _haveServerPassword;
};
}

View File

@ -71,138 +71,6 @@ function foxxManager (options) {
return results;
}
// TODO write test for 2.6-style queues
// testFuncs.queue_legacy = function (options) {
// if (options.skipFoxxQueues) {
// print('skipping test of legacy queue job types')
// return {}
// }
// var startTime
// var queueAppMountPath = '/test-queue-legacy'
// print('Testing legacy queue job types')
// var instanceInfo = pu.startInstance('tcp', options, [], 'queue_legacy')
// if (instanceInfo === false) {
// return {status: false, message: 'failed to start server!'}
// }
// var data = {
// naive: {_key: 'potato', hello: 'world'},
// forced: {_key: 'tomato', hello: 'world'},
// plain: {_key: 'banana', hello: 'world'}
// }
// var results = {}
// results.install = pu.run.arangoshCmd(options, instanceInfo, {
// 'configuration': 'etc/testing/foxx-manager.conf'
// }, [
// 'install',
// 'js/common/test-data/apps/queue-legacy-test',
// queueAppMountPath
// ])
// print('Restarting without foxx-queues-warmup-exports...')
// pu.shutdownInstance(instanceInfo, options)
// instanceInfo = pu.startInstance('tcp', options, {
// 'server.foxx-queues-warmup-exports': 'false'
// }, 'queue_legacy', instanceInfo.flatTmpDataDir)
// if (instanceInfo === false) {
// return {status: false, message: 'failed to restart server!'}
// }
// print('done.')
// var res, body
// startTime = time()
// try {
// res = download(
// instanceInfo.url + queueAppMountPath + '/',
// JSON.stringify(data.naive),
// {method: 'POST'}
// )
// body = JSON.parse(res.body)
// results.naive = {status: body.success === false, message: JSON.stringify({body: res.body, code: res.code})}
// } catch (e) {
// results.naive = {status: true, message: JSON.stringify({body: res.body, code: res.code})}
// }
// results.naive.duration = time() - startTime
// startTime = time()
// try {
// res = download(
// instanceInfo.url + queueAppMountPath + '/?allowUnknown=true',
// JSON.stringify(data.forced),
// {method: 'POST'}
// )
// body = JSON.parse(res.body)
// results.forced = (
// body.success
// ? {status: true}
// : {status: false, message: body.error, stacktrace: body.stacktrace}
// )
// } catch (e) {
// results.forced = {status: false, message: JSON.stringify({body: res.body, code: res.code})}
// }
// results.forced.duration = time() - startTime
// print('Restarting with foxx-queues-warmup-exports...')
// pu.shutdownInstance(instanceInfo, options)
// instanceInfo = pu.startInstance('tcp', options, {
// 'server.foxx-queues-warmup-exports': 'true'
// }, 'queue_legacy', instanceInfo.flatTmpDataDir)
// if (instanceInfo === false) {
// return {status: false, message: 'failed to restart server!'}
// }
// print('done.')
// startTime = time()
// try {
// res = download(instanceInfo.url + queueAppMountPath + '/', JSON.stringify(data.plain), {method: 'POST'})
// body = JSON.parse(res.body)
// results.plain = (
// body.success
// ? {status: true}
// : {status: false, message: JSON.stringify({body: res.body, code: res.code})}
// )
// } catch (e) {
// results.plain = {status: false, message: JSON.stringify({body: res.body, code: res.code})}
// }
// results.plain.duration = time() - startTime
// startTime = time()
// try {
// for (var i = 0; i < 60; i++) {
// wait(1)
// res = download(instanceInfo.url + queueAppMountPath + '/')
// body = JSON.parse(res.body)
// if (body.length === 2) {
// break
// }
// }
// results.final = (
// body.length === 2 && body[0]._key === data.forced._key && body[1]._key === data.plain._key
// ? {status: true}
// : {status: false, message: JSON.stringify({body: res.body, code: res.code})}
// )
// } catch (e) {
// results.final = {status: false, message: JSON.stringify({body: res.body, code: res.code})}
// }
// results.final.duration = time() - startTime
// results.uninstall = pu.run.arangoshCmd(options, instanceInfo, {
// 'configuration': 'etc/testing/foxx-manager.conf'
// }, [
// 'uninstall',
// queueAppMountPath
// ])
// print('Shutting down...')
// pu.shutdownInstance(instanceInfo, options)
// print('done.')
// if ((!options.skipLogAnalysis) &&
// instanceInfo.hasOwnProperty('importantLogLines') &&
// Object.keys(instanceInfo.importantLogLines).length > 0) {
// print('Found messages in the server logs: \n' + yaml.safeDump(instanceInfo.importantLogLines))
// }
// return results
// }
function setup (testFns, defaultFns, opts, fnDocs, optionsDoc) {
testFns['foxx_manager'] = foxxManager;
for (var attrname in functionsDocumentation) { fnDocs[attrname] = functionsDocumentation[attrname]; }