]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Increase the global value of jasmine timeout
authorTiago Melo <tmelo@suse.com>
Thu, 12 Sep 2019 09:00:17 +0000 (09:00 +0000)
committerTiago Melo <tmelo@suse.com>
Thu, 12 Sep 2019 14:23:05 +0000 (14:23 +0000)
Some tests are taking longer than the default jasmine timeout to finish
and are causing a failure.

This commit will increase the timeout to 5 minutes,
removing the need to increase it for each failing test.

Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard/frontend/e2e/cluster/logs.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/rgw/users.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/e2e/ui/dashboard.e2e-spec.ts
src/pybind/mgr/dashboard/frontend/protractor.conf.js

index dca739c3c5445de5ebab0b9fdf193ca00c53a8c9..47c95a39bdcf70b058294ecbfa32576e8570e18d 100644 (file)
@@ -69,13 +69,6 @@ describe('Logs page', () => {
   });
 
   describe('audit logs respond to editing configuration setting test', () => {
-    let originalTimeout;
-
-    beforeEach(() => {
-      originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
-      jasmine.DEFAULT_TIMEOUT_INTERVAL = 200000;
-    });
-
     it('should change config settings and check audit logs reacted', async () => {
       await configuration.navigateTo();
       await configuration.edit(configname, ['global', '5']);
@@ -86,9 +79,5 @@ describe('Logs page', () => {
       await configuration.navigateTo();
       await configuration.configClear(configname);
     });
-
-    afterEach(function() {
-      jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
-    });
   });
 });
index 29f1c7e78ac77047e1224130afc5214be35492b5..4caaa4df17587252cd2ba4092c0592baafef4652 100644 (file)
@@ -43,12 +43,7 @@ describe('RGW users page', () => {
   });
 
   describe('Invalid input test', () => {
-    let originalTimeout;
-
     beforeAll(async () => {
-      originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
-      jasmine.DEFAULT_TIMEOUT_INTERVAL = 200000;
-
       await users.navigateTo();
     });
 
@@ -59,9 +54,5 @@ describe('RGW users page', () => {
     it('should put invalid input into user edit form and check fields are marked invalid', async () => {
       await users.invalidEdit();
     });
-
-    afterAll(function() {
-      jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
-    });
   });
 });
index 3ec8719bc5e6fae109b5024c6483bf7fe5757c56..d15c358d52505e41bd3948436a186e387c2b2108 100644 (file)
@@ -94,60 +94,47 @@ describe('Dashboard Main Page', () => {
     });
   });
 
-  describe('Correct information', () => {
-    let originalTimeout;
+  it('Should check that dashboard cards have correct information', async () => {
+    interface TestSpec {
+      cardName: string;
+      regexMatcher?: RegExp;
+      pageObject: PageHelper;
+    }
 
-    beforeEach(async () => {
-      originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
-      jasmine.DEFAULT_TIMEOUT_INTERVAL = 200000;
-    });
-
-    it('Should check that dashboard cards have correct information', async () => {
-      interface TestSpec {
-        cardName: string;
-        regexMatcher?: RegExp;
-        pageObject: PageHelper;
-      }
-
-      const testSpecs: TestSpec[] = [
-        { cardName: 'Object Gateways', regexMatcher: /(\d+)\s+total/, pageObject: daemons },
-        { cardName: 'Monitors', regexMatcher: /(\d+)\s+\(quorum/, pageObject: monitors },
-        { cardName: 'Hosts', regexMatcher: /(\d+)\s+total/, pageObject: hosts },
-        { cardName: 'OSDs', regexMatcher: /(\d+)\s+total/, pageObject: osds },
-        { cardName: 'Pools', pageObject: pools },
-        { cardName: 'iSCSI Gateways', regexMatcher: /(\d+)\s+total/, pageObject: iscsi }
-      ];
+    const testSpecs: TestSpec[] = [
+      { cardName: 'Object Gateways', regexMatcher: /(\d+)\s+total/, pageObject: daemons },
+      { cardName: 'Monitors', regexMatcher: /(\d+)\s+\(quorum/, pageObject: monitors },
+      { cardName: 'Hosts', regexMatcher: /(\d+)\s+total/, pageObject: hosts },
+      { cardName: 'OSDs', regexMatcher: /(\d+)\s+total/, pageObject: osds },
+      { cardName: 'Pools', pageObject: pools },
+      { cardName: 'iSCSI Gateways', regexMatcher: /(\d+)\s+total/, pageObject: iscsi }
+    ];
 
-      for (let i = 0; i < testSpecs.length; i++) {
-        const spec = testSpecs[i];
-        await dashboard.navigateTo();
-        const infoCardBodyText = await dashboard.infoCardBodyText(spec.cardName);
-        let dashCount = 0;
-        if (spec.regexMatcher) {
-          const match = infoCardBodyText.match(new RegExp(spec.regexMatcher));
-          if (match && match.length > 1) {
-            dashCount = Number(match[1]);
-          } else {
-            return Promise.reject(
-              `Regex ${spec.regexMatcher} did not find a match for card with name ` +
-                `${spec.cardName}`
-            );
-          }
+    for (let i = 0; i < testSpecs.length; i++) {
+      const spec = testSpecs[i];
+      await dashboard.navigateTo();
+      const infoCardBodyText = await dashboard.infoCardBodyText(spec.cardName);
+      let dashCount = 0;
+      if (spec.regexMatcher) {
+        const match = infoCardBodyText.match(new RegExp(spec.regexMatcher));
+        if (match && match.length > 1) {
+          dashCount = Number(match[1]);
         } else {
-          dashCount = Number(infoCardBodyText);
+          return Promise.reject(
+            `Regex ${spec.regexMatcher} did not find a match for card with name ` +
+              `${spec.cardName}`
+          );
         }
-        await spec.pageObject.navigateTo();
-        const tableCount = await spec.pageObject.getTableTotalCount();
-        await expect(dashCount).toBe(
-          tableCount,
-          `Text of card "${spec.cardName}" and regex "${spec.regexMatcher}" resulted in ${dashCount} ` +
-            `but did not match table count ${tableCount}`
-        );
+      } else {
+        dashCount = Number(infoCardBodyText);
       }
-    });
-
-    afterEach(function() {
-      jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
-    });
+      await spec.pageObject.navigateTo();
+      const tableCount = await spec.pageObject.getTableTotalCount();
+      await expect(dashCount).toBe(
+        tableCount,
+        `Text of card "${spec.cardName}" and regex "${spec.regexMatcher}" resulted in ${dashCount} ` +
+          `but did not match table count ${tableCount}`
+      );
+    }
   });
 });
index 143437a81f7a4303e22bbff97ae578718ddc97b7..1445893f1e26d8f476943c41075b1324eeca894b 100644 (file)
@@ -28,7 +28,7 @@ const config = {
   framework: 'jasmine',
   jasmineNodeOpts: {
     showColors: true,
-    defaultTimeoutInterval: 30000,
+    defaultTimeoutInterval: 300000,
     print: function() {}
   },
   params: {