Compare commits

...

1 Commits

Author SHA1 Message Date
Electra Chong bccadaac91 test: add debug console.logs 2017-09-22 14:25:32 -07:00
2 changed files with 7 additions and 1 deletions

View File

@ -42,6 +42,9 @@ function clientCheck(log, cb) {
} }
}); });
async.parallel(clientTasks, (err, results) => { async.parallel(clientTasks, (err, results) => {
process.stdout.write('=======================\n');
process.stdout.write('results of client check healthcheck\n');
process.stdout.write(`${JSON.stringify(results, null, 4)}\n`);
let fail = false; let fail = false;
// obj will be an object of the healthcheck results of // obj will be an object of the healthcheck results of
// every backends. No errors were returned directly to // every backends. No errors were returned directly to
@ -49,6 +52,9 @@ function clientCheck(log, cb) {
// manual check makes S3 return 500 error if any backend failed // manual check makes S3 return 500 error if any backend failed
const obj = results.reduce((obj, item) => Object.assign(obj, item), {}); const obj = results.reduce((obj, item) => Object.assign(obj, item), {});
fail = Object.keys(obj).some(k => obj[k].error); fail = Object.keys(obj).some(k => obj[k].error);
process.stdout.write('obj\n');
process.stdout.write(`${JSON.stringify(obj, null, 4)}\n`);
process.stdout.write('======================\n');
if (fail) { if (fail) {
return cb(errors.InternalError, obj); return cb(errors.InternalError, obj);
} }

View File

@ -8,7 +8,7 @@ const { config } = require('../../lib/Config');
const log = new DummyRequestLogger(); const log = new DummyRequestLogger();
const locConstraints = Object.keys(config.locationConstraints); const locConstraints = Object.keys(config.locationConstraints);
describe('Healthcheck response', () => { describe.only('Healthcheck response', () => {
it('should return no error', done => { it('should return no error', done => {
clientCheck(log, err => { clientCheck(log, err => {
assert.strictEqual(err, null, assert.strictEqual(err, null,