mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Disable verbosity by default in account_tx-test.js (still commented out)
This commit is contained in:
@@ -10,7 +10,7 @@ var testutils = require("./testutils");
|
||||
|
||||
require('../src/js/config').load(require('./config'));
|
||||
|
||||
buster.testRunner.timeout = 250000; //This is a very long test!
|
||||
buster.testRunner.timeout = 350000; //This is a very long test!
|
||||
|
||||
|
||||
// Hard-coded limits we'll be testing:
|
||||
@@ -23,8 +23,9 @@ var OFFSET = 180;
|
||||
var LIMIT = 170;
|
||||
var SECOND_BATCH = 10; // Between NONBINARY_LIMIT and BINARY_LIMIT
|
||||
var THIRD_BATCH = 295; // Exceeds both limits
|
||||
var VERBOSE = false;
|
||||
|
||||
buster.testCase("// Account_tx tests LITTERS OUTPUT", {
|
||||
buster.testCase("//Account_tx tests", {
|
||||
'setUp' : testutils.build_setup(),
|
||||
'tearDown' : testutils.build_teardown(),
|
||||
|
||||
@@ -40,17 +41,17 @@ buster.testCase("// Account_tx tests LITTERS OUTPUT", {
|
||||
.offer_create("root", "500", "100/USD/root")
|
||||
.on('proposed', function (m) {
|
||||
transactionCounter++;
|
||||
console.log('Submitted transaction', transactionCounter);
|
||||
if (VERBOSE) console.log('Submitted transaction', transactionCounter);
|
||||
|
||||
callback(m.result !== 'tesSUCCESS');
|
||||
})
|
||||
.on('final', function (m) {
|
||||
f++;
|
||||
console.log("Finalized transaction", f);
|
||||
if (VERBOSE) console.log("Finalized transaction", f);
|
||||
buster.assert.equals('tesSUCCESS', m.metadata.TransactionResult);
|
||||
buster.assert(final_create);
|
||||
if ( f == transactionCounter ) {
|
||||
console.log("All transactions have been finalized.");
|
||||
if (VERBOSE) console.log("All transactions have been finalized.");
|
||||
functionHolder();
|
||||
}
|
||||
})
|
||||
@@ -64,7 +65,7 @@ buster.testCase("// Account_tx tests LITTERS OUTPUT", {
|
||||
}
|
||||
functionHolder = whenDone; //lolwut
|
||||
async.parallel(bunchOfOffers, function (error) {
|
||||
console.log("Accepting ledger.");
|
||||
if (VERBOSE) console.log("Accepting ledger.");
|
||||
buster.refute(error);
|
||||
self.remote
|
||||
.once('ledger_closed', function (message) {
|
||||
@@ -101,18 +102,18 @@ buster.testCase("// Account_tx tests LITTERS OUTPUT", {
|
||||
|
||||
function standardErrorHandler(callback) {
|
||||
return function(r) {
|
||||
console.log("ERROR!");
|
||||
console.log(r);
|
||||
if (VERBOSE) console.log("ERROR!");
|
||||
if (VERBOSE) console.log(r);
|
||||
callback(r);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function runTests(self, actualNumberOfTransactions, offset, limit, finalCallback) {
|
||||
console.log("Testing batch with offset and limit:", offset, limit);
|
||||
if (VERBOSE) console.log("Testing batch with offset and limit:", offset, limit);
|
||||
async.series([
|
||||
function(callback) {
|
||||
console.log('nonbinary');
|
||||
if (VERBOSE) console.log('nonbinary');
|
||||
self.remote.request_account_tx({
|
||||
account:ACCOUNT,
|
||||
ledger_index_min:-1,
|
||||
@@ -120,7 +121,6 @@ buster.testCase("// Account_tx tests LITTERS OUTPUT", {
|
||||
offset:offset,
|
||||
limit:limit
|
||||
}).on('success', function (r) {
|
||||
//console.log("GOT STUFF!",r);
|
||||
if (r.transactions) {
|
||||
var targetLength = Math.min(NONBINARY_LIMIT, limit ? Math.min(limit,actualNumberOfTransactions-offset) : actualNumberOfTransactions-offset);
|
||||
buster.assert(r.transactions.length == targetLength, "Got "+r.transactions.length+" transactions; expected "+targetLength );
|
||||
@@ -128,8 +128,6 @@ buster.testCase("// Account_tx tests LITTERS OUTPUT", {
|
||||
for (var i=0; i<r.transactions.length-1; i++) {
|
||||
var t1 = r.transactions[i].tx;
|
||||
var t2 = r.transactions[i+1].tx;
|
||||
//buster.assert(t1.inLedger<t2.inLedger || (t1.inLedger==t2.inLedger && t1.Sequence < t2.Sequence ),
|
||||
// "Transactions were not ordered correctly: "+t1.inLedger+"#"+t1.Sequence+" should not have come before "+t2.inLedger+"#"+t2.Sequence);
|
||||
buster.assert(t1.inLedger<=t2.inLedger,
|
||||
"Transactions were not ordered correctly: "+t1.inLedger+"#"+t1.Sequence+" should not have come before "+t2.inLedger+"#"+t2.Sequence);
|
||||
}
|
||||
@@ -144,7 +142,7 @@ buster.testCase("// Account_tx tests LITTERS OUTPUT", {
|
||||
},
|
||||
|
||||
function(callback) {
|
||||
console.log('binary');
|
||||
if (VERBOSE) console.log('binary');
|
||||
self.remote.request_account_tx({
|
||||
account:ACCOUNT,
|
||||
ledger_index_min:-1,
|
||||
@@ -153,7 +151,6 @@ buster.testCase("// Account_tx tests LITTERS OUTPUT", {
|
||||
offset:offset,
|
||||
limit:limit
|
||||
}).on('success', function (r) {
|
||||
//console.log("GOT STUFF!",r);
|
||||
if (r.transactions) {
|
||||
var targetLength = Math.min(BINARY_LIMIT, limit ? Math.min(limit,actualNumberOfTransactions-offset) : actualNumberOfTransactions-offset);
|
||||
buster.assert(r.transactions.length == targetLength, "Got "+r.transactions.length+" transactions; expected "+targetLength );
|
||||
@@ -167,7 +164,7 @@ buster.testCase("// Account_tx tests LITTERS OUTPUT", {
|
||||
},
|
||||
|
||||
function(callback) {
|
||||
console.log('nonbinary+offset');
|
||||
if (VERBOSE) console.log('nonbinary+offset');
|
||||
self.remote.request_account_tx({
|
||||
account:ACCOUNT,
|
||||
ledger_index_min:-1,
|
||||
@@ -176,7 +173,6 @@ buster.testCase("// Account_tx tests LITTERS OUTPUT", {
|
||||
offset:offset,
|
||||
limit:limit
|
||||
}).on('success', function (r) {
|
||||
//console.log("GOT STUFF!",r);
|
||||
if (r.transactions) {
|
||||
var targetLength = Math.min(NONBINARY_LIMIT, limit ? Math.min(limit,actualNumberOfTransactions-offset) : actualNumberOfTransactions-offset );
|
||||
buster.assert(r.transactions.length == targetLength, "Got "+r.transactions.length+" transactions; expected "+targetLength );
|
||||
|
||||
Reference in New Issue
Block a user