Quellcode durchsuchen

test: Wait longer for cron

Girish Ramakrishnan vor 7 Jahren
Ursprung
Commit
8d4a5b66e6
1 geänderte Dateien mit 4 neuen und 5 gelöschten Zeilen
  1. 4 5
      test/test.js

+ 4 - 5
test/test.js

@@ -250,15 +250,14 @@ describe('Application life cycle test', function () {
         this.timeout(6 * 60 * 1000); // cron runs only every 5 minutes
         console.log('It can take upto 6 mins to detect that cron is working');
 
-        // cron jobs are only executed when app is running and healthy
-        setTimeout(function () {
+        function checkLogs() {
             var logs = execSync('cloudron logs --lines 1000 --app ' + app.id).toString('utf8');
             if (logs.indexOf('Executed the cron event \'wp_version_check\'') !== -1) return done();
 
-            console.log(logs);
+            setTimeout(checkLogs, 45000);
+        }
 
-            done(new Error('cron jobs are possibly not running'));
-        }, 45000);
+        setTimeout(checkLogs, 45000);
     });
 
     it('move to different location', function () {