Megatest

Check-in [e2b136c3de]
Login
Overview
Comment:Keep servers alive only if have RUNNING or REMOTEHOSTSTART tests
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.60
Files: files | file ages | folders
SHA1: e2b136c3ded3452f190f5f0dee4e71489cfcd355
User & Date: matt on 2014-10-06 00:05:07
Other Links: branch diff | manifest | tags
Context
2014-10-06
05:38
Added db stats gathering check-in: cf842b155e user: matt tags: v1.60
00:05
Keep servers alive only if have RUNNING or REMOTEHOSTSTART tests check-in: e2b136c3de user: matt tags: v1.60
2014-10-05
23:51
Lazy server starting mostly working well check-in: abf327cf94 user: matt tags: v1.60
Changes

Modified db.scm from [602708e9c7] to [39cecd266e].

1515
1516
1517
1518
1519
1520
1521














1522
1523
1524
1525
1526
1527
1528
       (set! res count))
     (db:get-db dbstruct run-id)
     ;; WARNING BUG EDIT ME - merged from v1.55 - not sure what is right here ...
     ;; "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id NOT IN (SELECT id FROM runs WHERE state='deleted') AND NOT (uname = 'n/a' AND item_path = '');")
     "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=?;" 
     run-id) ;; NOT IN (SELECT id FROM runs WHERE state='deleted');")
    res))















;; NEW BEHAVIOR: Look only at single run with run-id
;; 
;; (define (db:get-running-stats dbstruct run-id)
(define (db:get-count-tests-running-for-run-id dbstruct run-id)
  (let ((res 0))
    (sqlite3:for-each-row







>
>
>
>
>
>
>
>
>
>
>
>
>
>







1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
       (set! res count))
     (db:get-db dbstruct run-id)
     ;; WARNING BUG EDIT ME - merged from v1.55 - not sure what is right here ...
     ;; "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id NOT IN (SELECT id FROM runs WHERE state='deleted') AND NOT (uname = 'n/a' AND item_path = '');")
     "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=?;" 
     run-id) ;; NOT IN (SELECT id FROM runs WHERE state='deleted');")
    res))

;; NEW BEHAVIOR: Count tests running in only one run!
;;
(define (db:get-count-tests-actually-running dbstruct run-id)
  (let ((res 0))
    (sqlite3:for-each-row
     (lambda (count)
       (set! res count))
     (db:get-db dbstruct run-id)
     ;; WARNING BUG EDIT ME - merged from v1.55 - not sure what is right here ...
     ;; "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id NOT IN (SELECT id FROM runs WHERE state='deleted') AND NOT (uname = 'n/a' AND item_path = '');")
     "SELECT count(id) FROM tests WHERE state in ('RUNNING','REMOTEHOSTSTART') AND run_id=?;" 
     run-id) ;; NOT IN (SELECT id FROM runs WHERE state='deleted');")
    res))

;; NEW BEHAVIOR: Look only at single run with run-id
;; 
;; (define (db:get-running-stats dbstruct run-id)
(define (db:get-count-tests-running-for-run-id dbstruct run-id)
  (let ((res 0))
    (sqlite3:for-each-row

Modified http-transport.scm from [02f4174079] to [962c24d755].

420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
      ;;
      (if (and *server-run*
	       (or (> (+ last-access server-timeout)
		      (current-seconds))
		   (and (eq? run-id 0)
			(> (tasks:num-servers-non-zero-running tdb) 0))
		   (and (not (eq? run-id 0)) ;; only makes sense in non-zero run-id servers
			(> (db:get-count-tests-running *inmemdb* run-id) 0))
		   ))
	  (begin
	    (debug:print-info 0 "Server continuing, seconds since last db access: " (- (current-seconds) last-access))
	    ;;
	    ;; Consider implementing some smarts here to re-insert the record or kill self is
	    ;; the db indicates so
	    ;;







|







420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
      ;;
      (if (and *server-run*
	       (or (> (+ last-access server-timeout)
		      (current-seconds))
		   (and (eq? run-id 0)
			(> (tasks:num-servers-non-zero-running tdb) 0))
		   (and (not (eq? run-id 0)) ;; only makes sense in non-zero run-id servers
			(> (db:get-count-tests-actually-running *inmemdb* run-id) 0))
		   ))
	  (begin
	    (debug:print-info 0 "Server continuing, seconds since last db access: " (- (current-seconds) last-access))
	    ;;
	    ;; Consider implementing some smarts here to re-insert the record or kill self is
	    ;; the db indicates so
	    ;;