From 7411132164120d39341d3f55530c8012ea2d6ba6 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Thu, 19 Nov 2015 11:06:01 -0600 Subject: [PATCH 1/6] Steps to debug and/or fix functional test timeouts. --- test/functional/apps/discover/_discover.js | 2 -- test/functional/apps/discover/index.js | 1 + test/intern.js | 2 +- test/support/pages/Common.js | 12 ++++++++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index 44320025b7a1..2e366c27b5f4 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -12,7 +12,6 @@ define(function (require) { var settingsPage; var discoverPage; var remote; - this.timeout = 60000; bdd.before(function () { common = new Common(this.remote); @@ -71,7 +70,6 @@ define(function (require) { bdd.it('save query should show toast message and display query name', function () { var expectedSavedQueryMessage = 'Discover: Saved Data Source "' + queryName1 + '"'; - this.timeout = 60000; return discoverPage.saveSearch(queryName1) .then(function () { return headerPage.getToastMessage(); diff --git a/test/functional/apps/discover/index.js b/test/functional/apps/discover/index.js index 2e1df80ac7ca..9b0bfb7109e7 100644 --- a/test/functional/apps/discover/index.js +++ b/test/functional/apps/discover/index.js @@ -19,6 +19,7 @@ define(function (require) { bdd.before(function () { common = new Common(this.remote); remote = this.remote; + this.timeout = 120000; }); bdd.after(function unloadMakelogs() { diff --git a/test/intern.js b/test/intern.js index a1f3ec28e0f4..913d3ec11f8c 100644 --- a/test/intern.js +++ b/test/intern.js @@ -3,7 +3,7 @@ define(function (require) { var _ = require('intern/dojo/node!lodash'); return _.assign({ - debug: false, + debug: true, capabilities: { 'selenium-version': '2.47.1', 'idle-timeout': 30 diff --git a/test/support/pages/Common.js b/test/support/pages/Common.js index 567590f35851..38f946b2991c 100644 --- a/test/support/pages/Common.js +++ b/test/support/pages/Common.js @@ -31,7 +31,10 @@ define(function (require) { if (testStatusPage !== false) { return self.checkForKibanaApp() .then(function (kibanaLoaded) { - if (!kibanaLoaded) throw new Error('Kibana is not loaded, retrying'); + if (!kibanaLoaded) { + throw new Error(moment().format('HH:mm:ss.SSS') + ': ' + + 'Kibana is not loaded, retrying'); + } }); } }) @@ -40,7 +43,12 @@ define(function (require) { }) .then(function (currentUrl) { var navSuccessful = new RegExp(appUrl).test(currentUrl); - if (!navSuccessful) throw new Error('App failed to load: ' + appName); + if (!navSuccessful) { + throw new Error(moment().format('HH:mm:ss.SSS') + ': ' + + 'App failed to load: ' + appName + + ' in ' + defaultTimeout + 'ms' + + ' currentUrl = ' + currentUrl); + } }); }); }; From 43eb32b6d626fbbcc17d99d80470c3e2c99270fd Mon Sep 17 00:00:00 2001 From: LeeDr Date: Thu, 19 Nov 2015 11:30:52 -0600 Subject: [PATCH 2/6] Replace default 30 second timeout even on Settings app tests with 2 minute timeout. --- test/functional/apps/settings/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/apps/settings/index.js b/test/functional/apps/settings/index.js index df0753df07ce..37ac01a44813 100644 --- a/test/functional/apps/settings/index.js +++ b/test/functional/apps/settings/index.js @@ -16,6 +16,7 @@ define(function (require) { // on setup, we create an settingsPage instance // that we will use for all the tests bdd.before(function () { + this.timeout = 120000; return scenarioManager.reload('emptyKibana') .then(function () { return scenarioManager.loadIfEmpty('makelogs'); From 5f10d16f4df592c1336ab65ffeeb818d7d87e4ea Mon Sep 17 00:00:00 2001 From: LeeDr Date: Fri, 20 Nov 2015 12:39:05 -0600 Subject: [PATCH 3/6] Adding debug log before throwing errors. --- test/support/pages/Common.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/support/pages/Common.js b/test/support/pages/Common.js index 38f946b2991c..713ea591f3ea 100644 --- a/test/support/pages/Common.js +++ b/test/support/pages/Common.js @@ -32,8 +32,8 @@ define(function (require) { return self.checkForKibanaApp() .then(function (kibanaLoaded) { if (!kibanaLoaded) { - throw new Error(moment().format('HH:mm:ss.SSS') + ': ' + - 'Kibana is not loaded, retrying'); + self.debug('Kibana is not loaded, retrying'); + throw new Error('Kibana is not loaded, retrying'); } }); } @@ -44,8 +44,10 @@ define(function (require) { .then(function (currentUrl) { var navSuccessful = new RegExp(appUrl).test(currentUrl); if (!navSuccessful) { - throw new Error(moment().format('HH:mm:ss.SSS') + ': ' + - 'App failed to load: ' + appName + + self.debug('App failed to load: ' + appName + + ' in ' + defaultTimeout + 'ms' + + ' currentUrl = ' + currentUrl); + throw new Error('App failed to load: ' + appName + ' in ' + defaultTimeout + 'ms' + ' currentUrl = ' + currentUrl); } From 0d0628e5bd38730b721475ba871700ab081f5e7e Mon Sep 17 00:00:00 2001 From: LeeDr Date: Fri, 20 Nov 2015 13:34:13 -0600 Subject: [PATCH 4/6] Move timeout setting out one level from bdd.before to bdd.describe. --- test/functional/apps/discover/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/apps/discover/index.js b/test/functional/apps/discover/index.js index 9b0bfb7109e7..28d1e78bf3bd 100644 --- a/test/functional/apps/discover/index.js +++ b/test/functional/apps/discover/index.js @@ -13,13 +13,13 @@ define(function (require) { var scenarioManager; var remote; var scenarioManager = new ScenarioManager(url.format(config.servers.elasticsearch)); + this.timeout = 120000; // on setup, we create an settingsPage instance // that we will use for all the tests bdd.before(function () { common = new Common(this.remote); remote = this.remote; - this.timeout = 120000; }); bdd.after(function unloadMakelogs() { From 5f3b0ae4a2911aaca8534ec0d8926ceeefa07965 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Fri, 20 Nov 2015 13:43:26 -0600 Subject: [PATCH 5/6] Variablize 2 messages. --- test/support/pages/Common.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/support/pages/Common.js b/test/support/pages/Common.js index 713ea591f3ea..401e68e186b9 100644 --- a/test/support/pages/Common.js +++ b/test/support/pages/Common.js @@ -32,8 +32,9 @@ define(function (require) { return self.checkForKibanaApp() .then(function (kibanaLoaded) { if (!kibanaLoaded) { - self.debug('Kibana is not loaded, retrying'); - throw new Error('Kibana is not loaded, retrying'); + var msg = 'Kibana is not loaded, retrying'; + self.debug(msg); + throw new Error(msg); } }); } @@ -44,12 +45,11 @@ define(function (require) { .then(function (currentUrl) { var navSuccessful = new RegExp(appUrl).test(currentUrl); if (!navSuccessful) { - self.debug('App failed to load: ' + appName + + var msg = 'App failed to load: ' + appName + ' in ' + defaultTimeout + 'ms' + - ' currentUrl = ' + currentUrl); - throw new Error('App failed to load: ' + appName + - ' in ' + defaultTimeout + 'ms' + - ' currentUrl = ' + currentUrl); + ' currentUrl = ' + currentUrl; + self.debug(msg); + throw new Error(msg); } }); }); From 2488a626e2f01e3248c81f25f0fca81db0debf1d Mon Sep 17 00:00:00 2001 From: LeeDr Date: Fri, 20 Nov 2015 14:06:32 -0600 Subject: [PATCH 6/6] Move timeout in settings/index.js up to describe. --- test/functional/apps/settings/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/apps/settings/index.js b/test/functional/apps/settings/index.js index 37ac01a44813..90fbed52f13c 100644 --- a/test/functional/apps/settings/index.js +++ b/test/functional/apps/settings/index.js @@ -12,11 +12,11 @@ define(function (require) { bdd.describe('settings app', function () { var scenarioManager = new ScenarioManager(url.format(config.servers.elasticsearch)); + this.timeout = 120000; // on setup, we create an settingsPage instance // that we will use for all the tests bdd.before(function () { - this.timeout = 120000; return scenarioManager.reload('emptyKibana') .then(function () { return scenarioManager.loadIfEmpty('makelogs');