소스 검색

Fix cron test

Girish Ramakrishnan 7 년 전
부모
커밋
f6851c5d94
1개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 9 4
      test/test.js

+ 9 - 4
test/test.js

@@ -246,12 +246,17 @@ describe('Application life cycle test', function () {
     it('can login', login.bind(null, username, password));
 
     it('runs cron jobs', function (done) {
-        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();
+        this.timeout(120000);
 
-        console.log(logs);
+        // cron jobs are only executed when app is running and healthy
+        setTimeout(function () {
+            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();
 
-        done(new Error('cron jobs are possibly not running'));
+            console.log(logs);
+
+            done(new Error('cron jobs are possibly not running'));
+        }, 45000);
     });
 
     it('move to different location', function () {