diff --git a/package.json b/package.json index 4307bec30..dbb335d6e 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "scripts": { "migrate_local": "DATABASE_URL=mysql://root:@localhost/box node_modules/.bin/db-migrate up", "migrate_test": "BOX_ENV=test DATABASE_URL=mysql://root:@localhost/boxtest node_modules/.bin/db-migrate up", - "test": "npm run migrate_test && src/test/setupTest && BOX_ENV=test ./node_modules/istanbul/lib/cli.js test $1 ./node_modules/mocha/bin/_mocha -- --exit -R spec ./src/test ./src/routes/test", + "test": "npm run migrate_test && src/test/setupTest && BOX_ENV=test ./node_modules/istanbul/lib/cli.js test $1 ./node_modules/mocha/bin/_mocha -- --no-timeouts --exit -R spec ./src/test ./src/routes/test", "postmerge": "/bin/true", "precommit": "/bin/true", "prepush": "npm test", diff --git a/src/routes/test/apps-test.js b/src/routes/test/apps-test.js index 7ff7eabb5..018e02ffe 100644 --- a/src/routes/test/apps-test.js +++ b/src/routes/test/apps-test.js @@ -264,8 +264,6 @@ function stopBox(done) { } describe('App API', function () { - this.timeout(100000); - before(startBox); after(stopBox); @@ -618,11 +616,7 @@ describe('App API', function () { }); describe('App installation', function () { - this.timeout(100000); - var apiHockInstance = hock.createHock({ throwOnUnmatched: false }); - var apiHockServer; - var validCert1, validKey1; before(function (done) { @@ -820,7 +814,6 @@ describe('App installation', function () { }); it('installation - app can check addons', function (done) { - this.timeout(120000); console.log('This test can take a while as it waits for scheduler addon to tick 3'); checkAddons(appEntry, done); }); @@ -949,7 +942,6 @@ describe('App installation', function () { }); it('installation - app can check addons', function (done) { - this.timeout(120000); console.log('This test can take a while as it waits for scheduler addon to tick 2'); checkAddons(appEntry, done); }); @@ -1076,7 +1068,6 @@ describe('App installation', function () { }); it('installation - app can check addons', function (done) { - this.timeout(120000); console.log('This test can take a while as it waits for scheduler addon to tick 4'); checkAddons(appEntry, done); }); diff --git a/src/routes/test/clients-test.js b/src/routes/test/clients-test.js index ff5f53831..a0f00021c 100644 --- a/src/routes/test/clients-test.js +++ b/src/routes/test/clients-test.js @@ -483,8 +483,6 @@ describe('Clients', function () { }); describe('delete tokens by client', function () { - this.timeout(5000); - before(setup2); after(cleanup); diff --git a/src/routes/test/developer-test.js b/src/routes/test/developer-test.js index 744bf8b30..d53d9864b 100644 --- a/src/routes/test/developer-test.js +++ b/src/routes/test/developer-test.js @@ -37,8 +37,6 @@ function cleanup(done) { } describe('Developer API', function () { - this.timeout(20000); - describe('login', function () { before(function (done) { async.series([ diff --git a/src/routes/test/domains-test.js b/src/routes/test/domains-test.js index 79f19cce3..1cd1c9d4a 100644 --- a/src/routes/test/domains-test.js +++ b/src/routes/test/domains-test.js @@ -43,8 +43,6 @@ var DOMAIN_1 = { }; describe('Domains API', function () { - this.timeout(10000); - before(function (done) { config._reset(); config.setFqdn(DOMAIN); diff --git a/src/routes/test/eventlog-test.js b/src/routes/test/eventlog-test.js index a1f67abbc..a15684697 100644 --- a/src/routes/test/eventlog-test.js +++ b/src/routes/test/eventlog-test.js @@ -78,8 +78,6 @@ function cleanup(done) { } describe('Eventlog API', function () { - this.timeout(10000); - before(setup); after(cleanup); diff --git a/src/routes/test/mail-test.js b/src/routes/test/mail-test.js index 2ef82f334..93f63ea78 100644 --- a/src/routes/test/mail-test.js +++ b/src/routes/test/mail-test.js @@ -105,8 +105,6 @@ function cleanup(done) { } describe('Mail API', function () { - this.timeout(10000); - before(setup); after(cleanup); @@ -231,8 +229,6 @@ describe('Mail API', function () { var dnsAnswerQueue = []; var dkimDomain, spfDomain, mxDomain, dmarcDomain; - this.timeout(10000); - before(function (done) { var dns = require('../../native-dns.js'); diff --git a/src/routes/test/profile-test.js b/src/routes/test/profile-test.js index c24572dba..eac617ba8 100644 --- a/src/routes/test/profile-test.js +++ b/src/routes/test/profile-test.js @@ -24,8 +24,6 @@ const EMAIL_0_NEW_FALLBACK = 'stupIDfallback@me.com'; const DISPLAY_NAME_0_NEW = 'New Name'; describe('Profile API', function () { - this.timeout(5000); - var user_0 = null; var token_0; diff --git a/src/routes/test/ssh-test.js b/src/routes/test/ssh-test.js index f3a94a754..f6802ee47 100644 --- a/src/routes/test/ssh-test.js +++ b/src/routes/test/ssh-test.js @@ -61,8 +61,6 @@ function cleanup(done) { } describe('SSH API', function () { - this.timeout(10000); - before(setup); after(cleanup); diff --git a/src/routes/test/sysadmin-test.js b/src/routes/test/sysadmin-test.js index 9694efbc5..b9a885bff 100644 --- a/src/routes/test/sysadmin-test.js +++ b/src/routes/test/sysadmin-test.js @@ -65,29 +65,27 @@ function cleanup(done) { } describe('Internal API', function () { - this.timeout(5000); - before(setup); after(cleanup); describe('backup', function () { it('succeeds', function (done) { superagent.post(config.sysadminOrigin() + '/api/v1/backup') - .end(function (error, result) { - expect(result.statusCode).to.equal(202); + .end(function (error, result) { + expect(result.statusCode).to.equal(202); - function checkBackupStartEvent() { - eventlog.getAllPaged([ eventlog.ACTION_BACKUP_START ], '', 1, 100, function (error, result) { - expect(error).to.equal(null); + function checkBackupStartEvent() { + eventlog.getAllPaged([ eventlog.ACTION_BACKUP_START ], '', 1, 100, function (error, result) { + expect(error).to.equal(null); - if (result.length === 0) return setTimeout(checkBackupStartEvent, 1000); + if (result.length === 0) return setTimeout(checkBackupStartEvent, 1000); - done(); - }); - } + done(); + }); + } - checkBackupStartEvent(); - }); + checkBackupStartEvent(); + }); }); }); }); diff --git a/src/routes/test/users-test.js b/src/routes/test/users-test.js index 2428c648c..551e54ff1 100644 --- a/src/routes/test/users-test.js +++ b/src/routes/test/users-test.js @@ -82,8 +82,6 @@ function checkMails(number, done) { } describe('Users API', function () { - this.timeout(5000); - var user_0, user_1, user_2, user_4; var token = null, userToken = null; var token_1 = tokendb.generateToken(); diff --git a/src/test/backups-test.js b/src/test/backups-test.js index 77f585810..56a8f7fe5 100644 --- a/src/test/backups-test.js +++ b/src/test/backups-test.js @@ -73,8 +73,6 @@ describe('backups', function () { }); describe('cleanup', function () { - this.timeout(20000); - var BACKUP_0 = { id: 'backup-box-0', version: '1.0.0', @@ -286,8 +284,6 @@ describe('backups', function () { }); it('can backup', function (done) { - this.timeout(6000); - createBackup(function (error, result) { expect(error).to.be(null); expect(fs.statSync(path.join(gBackupConfig.backupFolder, 'snapshot/box.tar.gz')).nlink).to.be(2); // hard linked to a rotated backup @@ -300,8 +296,6 @@ describe('backups', function () { }); it('can take another backup', function (done) { - this.timeout(6000); - createBackup(function (error, result) { expect(error).to.be(null); expect(fs.statSync(path.join(gBackupConfig.backupFolder, 'snapshot/box.tar.gz')).nlink).to.be(2); // hard linked to a rotated backup diff --git a/src/test/database-test.js b/src/test/database-test.js index 015032648..de5975402 100644 --- a/src/test/database-test.js +++ b/src/test/database-test.js @@ -98,8 +98,6 @@ const TEST_DOMAIN = { }; describe('database', function () { - this.timeout(5000); - before(function (done) { config._reset(); config.setFqdn(TEST_DOMAIN.domain); diff --git a/src/test/dockerproxy-test.js b/src/test/dockerproxy-test.js index 8bff0a9be..f36f95435 100644 --- a/src/test/dockerproxy-test.js +++ b/src/test/dockerproxy-test.js @@ -42,7 +42,6 @@ describe('Dockerproxy', function () { }); // uncomment this to run the proxy for manual testing - // this.timeout(1000000); // it('wait', function (done) {} ); it('can get info', function (done) { diff --git a/src/test/ldap-test.js b/src/test/ldap-test.js index 5fd670c26..4837d9283 100644 --- a/src/test/ldap-test.js +++ b/src/test/ldap-test.js @@ -202,8 +202,6 @@ function cleanup(done) { } describe('Ldap', function () { - this.timeout(10000); - before(setup); after(cleanup); diff --git a/src/test/server-test.js b/src/test/server-test.js index 4b80b5419..d63c35017 100644 --- a/src/test/server-test.js +++ b/src/test/server-test.js @@ -20,8 +20,6 @@ function cleanup(done) { } describe('Server', function () { - this.timeout(5000); - before(function () { config._reset(); config.setFqdn(DOMAIN); diff --git a/src/test/storage-test.js b/src/test/storage-test.js index e107016c6..fab72eb1b 100644 --- a/src/test/storage-test.js +++ b/src/test/storage-test.js @@ -16,9 +16,8 @@ var BackupsError = require('../backups.js').BackupsError, path = require('path'), rimraf = require('rimraf'), mkdirp = require('mkdirp'), - recursive_readdir = require("recursive-readdir"), + recursive_readdir = require('recursive-readdir'), s3 = require('../storage/s3.js'), - debug = require('debug')('box:storage-test'), gcs = require('../storage/gcs.js'), chunk = require('lodash.chunk'); @@ -203,8 +202,6 @@ describe('Storage', function () { }); describe('s3', function () { - this.timeout(10000); - var gS3Folder; var gBackupConfig = { provider: 's3', @@ -297,8 +294,6 @@ describe('Storage', function () { }); describe('gcs', function () { - this.timeout(10000); - var gBackupConfig = { provider: 'gcs', key: '', @@ -351,7 +346,7 @@ describe('Storage', function () { .pipe(fs.createWriteStream(ensurePathWritable(dst))) .on('end', cb) .on('error', notFoundHandler) - ; + ; } }; }; @@ -375,7 +370,7 @@ describe('Storage', function () { cb(null, gFiles, q.pageToken < chunkedFiles.length ? q : null); }); } - } + }; }}; }; gcs._mockInject(mockGCS);