Overview
Comment: | Cleaned up the checks for being in a megatest area, ensure all exit correctly |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | v1.5104 |
Files: | files | file ages | folders |
SHA1: |
52a15efc23c2a7091b2c34eacc655181 |
User & Date: | mrwellan on 2012-11-02 11:57:52 |
Other Links: | manifest | tags |
Context
2012-11-02
| ||
11:58 | Bumped version check-in: a95331bfec user: mrwellan tags: trunk, v1.5104 | |
11:57 | Cleaned up the checks for being in a megatest area, ensure all exit correctly check-in: 52a15efc23 user: mrwellan tags: trunk, v1.5104 | |
00:28 | Added check for version on client/server login. Converted to looking at heartbeat time instead of trying to connect to server check-in: af929ed4d8 user: matt tags: trunk, 1.5103 | |
Changes
Modified Makefile from [ae425a5adb] to [97c667eb36].
1 |
| | | 1 2 3 4 5 6 7 8 9 | PREFIX=$(PWD) CSCOPTS= INSTALL=install SRCFILES = common.scm items.scm launch.scm \ ods.scm runconfig.scm server.scm configf.scm \ db.scm keys.scm margs.scm megatest-version.scm \ process.scm runs.scm tasks.scm tests.scm genexample.scm |
︙ | ︙ |
Modified dashboard-guimonitor.scm from [a6d8f66529] to [74e70b90f3].
︙ | ︙ | |||
170 171 172 173 174 175 176 | (let ((tabtop (iup:tabs setuptab collateraltab fsltab toolstab))) (iup:attribute-set! tabtop "TABTITLE0" "Setup") (iup:attribute-set! tabtop "TABTITLE1" "Collateral") (iup:attribute-set! tabtop "TABTITLE2" "Fossil") (iup:attribute-set! tabtop "TABTITLE3" "Tools") tabtop)))) | > | | | | | | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | (let ((tabtop (iup:tabs setuptab collateraltab fsltab toolstab))) (iup:attribute-set! tabtop "TABTITLE0" "Setup") (iup:attribute-set! tabtop "TABTITLE1" "Collateral") (iup:attribute-set! tabtop "TABTITLE2" "Fossil") (iup:attribute-set! tabtop "TABTITLE3" "Tools") tabtop)))) ;; BUG: Remember to re-instate this!!!! ;; (on-exit (lambda () ;; (let ((tdb (tasks:open-db))) ;; ;; (print "On-exit called") ;; (tasks:remove-monitor-record tdb) ;; (sqlite3:finalize! tdb)))) (define (gui-monitor db) (let ((keys (db:get-keys db)) (tdb (tasks:open-db))) (tasks:register-monitor db tdb) ;;; let the other monitors know we are here (control-panel db tdb keys) ;(tasks:remove-monitor-record db) |
︙ | ︙ |
Modified dashboard.scm from [25760be9fa] to [9d10f68f9f].
︙ | ︙ | |||
633 634 635 636 637 638 639 | (cond ((args:get-arg "-run") (let ((runid (string->number (args:get-arg "-run")))) (if runid (begin (lambda (x) (on-exit (lambda () | | | 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 | (cond ((args:get-arg "-run") (let ((runid (string->number (args:get-arg "-run")))) (if runid (begin (lambda (x) (on-exit (lambda () (if *db* (sqlite3:finalize! *db*)))) (open-run-close examine-run *db* runid))) (begin (print "ERROR: runid is not a number " (args:get-arg "-run")) (exit 1))))) ((args:get-arg "-test") (let ((testid (string->number (args:get-arg "-test")))) (if testid |
︙ | ︙ |
Modified db.scm from [d14f94d1cd] to [2a2b5ea15a].
︙ | ︙ | |||
51 52 53 54 55 56 57 | #f)))) (if val (begin (debug:print-info 11 "db:set-sync, setting pragma synchronous to " val) (sqlite3:execute db (conc "PRAGMA synchronous = '" val "';")))))) (define (open-db) ;; (conc *toppath* "/megatest.db") (car *configinfo*))) | | > > > > | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | #f)))) (if val (begin (debug:print-info 11 "db:set-sync, setting pragma synchronous to " val) (sqlite3:execute db (conc "PRAGMA synchronous = '" val "';")))))) (define (open-db) ;; (conc *toppath* "/megatest.db") (car *configinfo*))) (if (not *toppath*) (if (not (setup-for-run)) (begin (debug:print 0 "ERROR: Attempted to open db when not in megatest area. Exiting.") (exit)))) (let* ((dbpath (conc *toppath* "/megatest.db")) ;; fname) (dbexists (file-exists? dbpath)) (db (sqlite3:open-database dbpath)) ;; (never-give-up-open-db dbpath)) (handler (make-busy-timeout (if (args:get-arg "-override-timeout") (string->number (args:get-arg "-override-timeout")) 136000)))) ;; 136000))) ;; 136000 = 2.2 minutes (debug:print-info 11 "open-db, dbpath=" dbpath " argv=" (argv)) |
︙ | ︙ |
Modified megatest.scm from [8dfdbfa547] to [15e38b91f5].
︙ | ︙ | |||
318 319 320 321 322 323 324 | (debug:print-info 1 "Killed server by pid at " hostname ":" port))) ;; (if zmq-socket (close-socket zmq-socket)) (format #t fmtstr id mt-ver pid hostname port start-time priority status))) servers) (debug:print-info 1 "Done with listservers") (exit) ;; must do, would have to add checks to many/all calls below | | > | 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | (debug:print-info 1 "Killed server by pid at " hostname ":" port))) ;; (if zmq-socket (close-socket zmq-socket)) (format #t fmtstr id mt-ver pid hostname port start-time priority status))) servers) (debug:print-info 1 "Done with listservers") (exit) ;; must do, would have to add checks to many/all calls below (set! *didsomething* #t)) (exit))) ;; if not list or kill then start a client (if appropriate) (if (or (args-defined? "-h" "-version" "-gen-megatest-area" "-gen-megatest-test") (eq? (length (hash-table-keys args:arg-hash)) 0)) (debug:print-info 1 "Server connection not needed") ;; ping servers only if -runall -runtests (let ((ping (args-defined? "-runall" "-runtests" "-remove-runs" "-set-state-status" "-rerun" "-rollup" "-lock" "-unlock" |
︙ | ︙ | |||
433 434 435 436 437 438 439 | (db:step-get-stepname step) (db:step-get-state step) (db:step-get-status step) (db:step-get-event_time step))) steps))))) tests)))) runs) | | | | 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | (db:step-get-stepname step) (db:step-get-state step) (db:step-get-status step) (db:step-get-event_time step))) steps))))) tests)))) runs) (set! *didsomething* #t)) (exit))) ;;====================================================================== ;; full run ;;====================================================================== ;; get lock in db for full run for this directory ;; for all tests with deps |
︙ | ︙ | |||
456 457 458 459 460 461 462 | ;; else ;; put task in deferred queue ;; if still ok to run tasks ;; process deferred tasks per above steps ;; run all tests are are Not COMPLETED and PASS or CHECK (if (args:get-arg "-runall") | < < < < < < < < < < < | | | | | | | | | | | < < | 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | ;; else ;; put task in deferred queue ;; if still ok to run tasks ;; process deferred tasks per above steps ;; run all tests are are Not COMPLETED and PASS or CHECK (if (args:get-arg "-runall") (general-run-call "-runall" "run all tests" (lambda (target runname keys keynames keyvallst) (runs:run-tests target runname (if (args:get-arg "-testpatt") (args:get-arg "-testpatt") "%/%") user args:arg-hash)))) ;;====================================================================== ;; run one test ;;====================================================================== ;; 1. find the config file ;; 2. change to the test directory |
︙ | ︙ | |||
894 895 896 897 898 899 900 | (server:client-setup)) (import readline) (import apropos) (gnu-history-install-file-manager (string-append (or (get-environment-variable "HOME") ".") "/.megatest_history")) (current-input-port (make-gnu-readline-port "megatest> ")) | | > | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 | (server:client-setup)) (import readline) (import apropos) (gnu-history-install-file-manager (string-append (or (get-environment-variable "HOME") ".") "/.megatest_history")) (current-input-port (make-gnu-readline-port "megatest> ")) (repl)) (exit)) (set! *didsomething* #t))) ;;====================================================================== ;; Exit and clean up ;;====================================================================== ;; this is the socket if we are a client |
︙ | ︙ |
Modified server.scm from [8939443630] to [59c1e6d986].
︙ | ︙ | |||
27 28 29 30 31 32 33 | (define (server:make-server-url hostport) (if (not hostport) #f (conc "tcp://" (car hostport) ":" (cadr hostport)))) (define (server:run hostn) (debug:print 0 "Attempting to start the server ...") | | > > > > > > | | | | | | | | | | | | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | (define (server:make-server-url hostport) (if (not hostport) #f (conc "tcp://" (car hostport) ":" (cadr hostport)))) (define (server:run hostn) (debug:print 0 "Attempting to start the server ...") (if (not *toppath*) (if (not (setup-for-run)) (begin (debug:print 0 "ERROR: cannot find megatest.config, cannot start server, exiting") (exit)))) (let* ((zmq-socket #f) (hostname (if (string=? "-" hostn) (get-host-name) hostn)) (ipaddrstr (let ((ipstr (if (string=? "-" hostn) (string-intersperse (map number->string (u8vector->list (hostname->ip hostname))) ".") #f))) (if ipstr ipstr hostname)))) (set! zmq-socket (server:find-free-port-and-open ipaddrstr zmq-socket 5555 0)) (set! *cache-on* #t) ;; what to do when we quit ;; (on-exit (lambda () (if (and *toppath* *server-id*) (begin (open-run-close tasks:server-deregister-self tasks:open-db #f)) (let loop () (let ((queue-len 0)) (thread-sleep! (random 5)) (mutex-lock! *incoming-mutex*) (set! queue-len (length *incoming-data*)) (mutex-unlock! *incoming-mutex*) (if (> queue-len 0) (begin (debug:print-info 0 "Queue not flushed, waiting ...") (loop)))))))) ;; The heavy lifting ;; (let loop () (let* ((rawmsg (receive-message* zmq-socket)) (params (db:string->obj rawmsg)) ;; (with-input-from-string rawmsg (lambda ()(deserialize)))) (res #f)) |
︙ | ︙ | |||
160 161 162 163 164 165 166 | (let ((ok (and (socket? zmq-socket) (cdb:logout zmq-socket *toppath* (server:get-client-signature))))) ;; (close-socket zmq-socket) ok)) ;; Do all the connection work, start a server if not already running (define (server:client-setup #!key (numtries 10)(do-ping #f)) | | > > > > | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | (let ((ok (and (socket? zmq-socket) (cdb:logout zmq-socket *toppath* (server:get-client-signature))))) ;; (close-socket zmq-socket) ok)) ;; Do all the connection work, start a server if not already running (define (server:client-setup #!key (numtries 10)(do-ping #f)) (if (not *toppath*) (if (not (setup-for-run)) (begin (debug:print 0 "ERROR: failed to find megatest.config, exiting") (exit)))) (let ((hostinfo (open-run-close tasks:get-best-server tasks:open-db do-ping: do-ping))) (if hostinfo (let ((host (car hostinfo)) (port (cadr hostinfo))) ;; (zsocket (caddr hostinfo))) ;; (set! *runremote* zsocket)) (let* ((host (car hostinfo)) |
︙ | ︙ | |||
201 202 203 204 205 206 207 | (process-run exe (list "-server" "-" "-debug" (conc *verbosity*))) (sleep 2) ;; not doing ping, assume the server started and registered itself (server:client-setup numtries: (- numtries 1) do-ping: #f)) (debug:print-info 1 "Too many retries, giving up"))))) (define (server:launch) | > | > > > | | | | | | | | | | | | | | | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | (process-run exe (list "-server" "-" "-debug" (conc *verbosity*))) (sleep 2) ;; not doing ping, assume the server started and registered itself (server:client-setup numtries: (- numtries 1) do-ping: #f)) (debug:print-info 1 "Too many retries, giving up"))))) (define (server:launch) (if (not *toppath*) (if (not (setup-for-run)) (begin (debug:print 0 "ERROR: cannot find megatest.config, exiting") (exit)))) (debug:print-info 0 "Starting the standalone server") (let ((hostinfo (open-run-close tasks:get-best-server tasks:open-db))) (if hostinfo (debug:print-info 1 "NOT starting new server, one is already running on " (car hostinfo) ":" (cadr hostinfo)) (if *toppath* (let* ((th2 (make-thread (lambda () (server:run (args:get-arg "-server"))))) (th3 (make-thread (lambda () (server:keep-running))))) (thread-start! th2) (thread-start! th3) (set! *didsomething* #t) (thread-join! th3)) (debug:print 0 "ERROR: Failed to setup for megatest"))))) (define (server:client-launch #!key (do-ping #f)) (if (server:client-setup do-ping: do-ping) (debug:print-info 2 "connected as client") (begin (debug:print 0 "ERROR: Failed to connect as client") (exit)))) |
︙ | ︙ |
Modified utils/mk_wrapper from [313bc7ad6e] to [af950f4763].
1 2 3 4 5 6 7 8 9 10 | #!/bin/bash prefix=$1 cmd=$2 echo "#!/bin/bash" if [ "$LD_LIBRARY_PATH" != "" ];then echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH" fi | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 | #!/bin/bash prefix=$1 cmd=$2 echo "#!/bin/bash" if [ "$LD_LIBRARY_PATH" != "" ];then echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH" fi fullcmd="$prefix/bin/$cmd" echo "$fullcmd \$*" |