Megatest

Diff
Login

Differences From Artifact [4356e24404]:

To Artifact [a74f9a32c4]:


463
464
465
466
467
468
469
470






471
472
473
474
475
476

477
478
479
480
481
482
483
463
464
465
466
467
468
469

470
471
472
473
474
475
476
477
478
479
480

481
482
483
484
485
486
487
488







-
+
+
+
+
+
+





-
+







       (db:set-var db "MEGATEST_VERSION" megatest-version))))))

;;======================================================================
;; M A I N T E N A N C E
;;======================================================================

(define (db:find-and-mark-incomplete db)
  (let ((incompleted '()))
  (let* ((incompleted '())
	 (deadtime-str (configf:lookup *configdat* "setup" "deadtime"))
	 (deadtime     (if (and deadtime-str
				(string->number deadtime-str))
			   (string->number deadtime-str)
			   1800)))
    (sqlite3:for-each-row 
     (lambda (test-id)
       (set! incompleted (cons test-id incompleted)))
     db
     "SELECT id FROM tests WHERE event_time<? AND state IN ('RUNNING','REMOTEHOSTSTART');"
     (- (current-seconds) 600)) ;; in RUNNING or REMOTEHOSTSTART for more than 10 minutes
     (- (current-seconds) deadtime)) ;; in RUNNING or REMOTEHOSTSTART for more than 10 minutes
    (sqlite3:for-each-row
     (lambda (test-id)
       (set! incompleted (cons test-id incompleted)))
     db
     "SELECT id FROM tests WHERE event_time<? AND state IN ('LAUNCHED');"
     (- (current-seconds)(* 60 60 24))) ;; in LAUNCHED for more than one day. Could be long due to job queues TODO/BUG: Need override for this in config
    ;; These are defunct tests, do not do all the overhead of set-state-status. Force them to INCOMPLETE.