Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -227,13 +227,13 @@ (define (db:set-tests-state-status db run-id testnames currstate currstatus newstate newstatus) (for-each (lambda (testname) (let ((qry (conc "UPDATE tests SET state=?,status=? WHERE " (if currstate (conc "state='" currstate "' AND ") "") (if currstatus (conc "status='" currstatus "' AND ") "") - " testname=? AND NOT (item_path='' AND testname in (SELECT DISTINCT testname FROM tests WHERE testname=? AND item_path != ''));"))) + " run_id=? AND testname=? AND NOT (item_path='' AND testname in (SELECT DISTINCT testname FROM tests WHERE testname=? AND item_path != ''));"))) ;;(debug:print 0 "QRY: " qry) - (sqlite3:execute db qry newstate newstatus testname testname))) + (sqlite3:execute db qry run-id newstate newstatus testname testname))) testnames)) (define (db:delete-tests-in-state db run-id state) (sqlite3:execute db "DELETE FROM tests WHERE state=? AND run_id=?;" state run-id)) Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -184,11 +184,17 @@ (cdr fullcmd)))) ;; launcher fullcmd)));; (apply cmd-run-proc-each-line launcher print fullcmd))) ;; (cmd-run->list fullcmd)) (debug:print 2 "Launching completed, updating db") (debug:print 4 "Launch results: " launch-results) (if (not launch-results) (begin - (print "ERROR: Failed to run " fullcmd ", exiting now") - (exit 1))) + (print "ERROR: Failed to run " (string-intersperse fullcmd " ") ", exiting now") + (sqlite3:finalize! db) + ;; good ole "exit" seems not to work + ;; (_exit 9) + ;; but this hack will work! Thanks go to Alan Post of the Chicken email list + (process-signal (current-process-id) signal/kill) + )) (alist->env-vars miscprevvals) (alist->env-vars testprevvals) - (alist->env-vars commonprevvals)))) + (alist->env-vars commonprevvals) + launch-results))) Index: process.scm ================================================================== --- process.scm +++ process.scm @@ -15,19 +15,22 @@ (define (cmd-run-proc-each-line cmd proc . params) (handle-exceptions exn (begin - (print "ERROR: Failed to run command: " cmd (string-intersperse params " ")) + (print "ERROR: Failed to run command: " cmd " " (string-intersperse params " ")) #f) - (let* ((fh (process cmd params))) + (let-values (((fh fho pid) (process cmd params))) (let loop ((curr (read-line fh)) (result '())) (if (not (eof-object? curr)) (loop (read-line fh) (append result (list (proc curr)))) - result))))) + (begin + (close-input-port fh) + (close-output-port fho) + result)))))) (define (cmd-run-proc-each-line-alt cmd proc) (let* ((fh (open-input-pipe cmd)) (res (port-proc->list fh proc)) (status (close-input-pipe fh))) Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -250,19 +250,21 @@ (define (runs:can-run-more-tests db) (let ((num-running (db:get-count-tests-running db)) (max-concurrent-jobs (config-lookup *configdat* "setup" "max_concurrent_jobs"))) (debug:print 2 "max-concurrent-jobs: " max-concurrent-jobs ", num-running: " num-running) - (if (or (not max-concurrent-jobs) - (and max-concurrent-jobs - (string->number max-concurrent-jobs) - (not (>= num-running (string->number max-concurrent-jobs))))) - #t - (begin - (debug:print 0 "WARNING: Max running jobs exceeded, current number running: " num-running - ", max_concurrent_jobs: " max-concurrent-jobs) - #f)))) + (if (not (eq? 0 *globalexitstatus*)) + #f + (if (or (not max-concurrent-jobs) + (and max-concurrent-jobs + (string->number max-concurrent-jobs) + (not (>= num-running (string->number max-concurrent-jobs))))) + #t + (begin + (debug:print 0 "WARNING: Max running jobs exceeded, current number running: " num-running + ", max_concurrent_jobs: " max-concurrent-jobs) + #f))))) (define (run-tests db test-names) (let* ((keys (db-get-keys db)) (keyvallst (keys->vallist keys #t)) (run-id (register-run db keys))) ;; test-name))) @@ -282,16 +284,18 @@ (for-each (lambda (test-name) (if (runs:can-run-more-tests db) (run-one-test db run-id test-name keyvallst) ;; add some delay - (sleep 2))) + ;(sleep 2) + )) test-names) ;; (run-waiting-tests db) (if (args:get-arg "-keepgoing") (let ((estrem (db:estimated-tests-remaining db run-id))) - (if (> estrem 0) + (if (and (> estrem 0) + (eq? *globalexitstatus* 0)) (begin (debug:print 1 "Keep going, estimated " estrem " tests remaining to run, will continue in 3 seconds ...") (sleep 3) (run-waiting-tests db) (loop (+ numtimes 1))))))))) @@ -415,11 +419,17 @@ (launch-cmd (lambda () (launch-test db run-id test-conf keyvallst test-name test-path itemdat))) (testrundat (list get-prereqs-cmd launch-cmd))) (if (or (args:get-arg "-force") (null? ((car testrundat)))) ;; are there any tests that must be run before this one... - ((cadr testrundat)) ;; this is the line that launches the test to the remote host + (if (not ((cadr testrundat))) ;; this is the line that launches the test to the remote host + (begin + (print "ERROR: Failed to launch the test. Exiting as soon as possible") + (set! *globalexitstatus* 1) ;; + (process-signal (current-process-id) signal/kill) + ;(exit 1) + )) (if (not (args:get-arg "-keepgoing")) (hash-table-set! *waiting-queue* new-test-name testrundat))))))) ((KILLED) (debug:print 1 "NOTE: " new-test-name " is already running or was explictly killed, use -force to launch it.")) ((LAUNCHED REMOTEHOSTSTART RUNNING) Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -5,10 +5,11 @@ runall : cd ../;make $(MEGATEST) -keepgoing -runall :sysname ubuntu :fsname nfs :datapath none :runname `date +%GWW%V.%u` -m "This is a comment specific to a run" -v test : + csi -I .. ../megatest.scm -- -runall :sysname ubuntu :fsname afs :datapath tmp :runname blah cd ../;make test make runall dashboard : cd ../;make dashboard Index: tests/megatest.config ================================================================== --- tests/megatest.config +++ tests/megatest.config @@ -11,10 +11,11 @@ [jobtools] # ## launcher launches jobs, the job is managed on the target host ## by megatest, comment out launcher to run local # workhosts localhost hermes launcher nbfake +# launcher nodanggood ## use "xterm -e csi -- " as a launcher to examine the launch environment. ## exit with (exit) ## get a shell with (system "bash") # launcher xterm -e csi -- Index: utils/installall.sh ================================================================== --- utils/installall.sh +++ utils/installall.sh @@ -91,11 +91,11 @@ fi if [[ `uname -a | grep x86_64` == "" ]]; then export files="cd-5.4.1_Linux${KTYPE}_lib.tar.gz im-3.6.3_Linux${KTYPE}_lib.tar.gz iup-3.5_Linux${KTYPE}_lib.tar.gz" else - export files="cd-5.4.1_Linux${KTYPE}_64_lib.tar.gz im-3.6.3_Linux${KTYPE}_64_lib.tar.gz iup-3.4_Linux${KTYPE}_64_lib.tar.gz" + export files="cd-5.4.1_Linux${KTYPE}_64_lib.tar.gz im-3.6.3_Linux${KTYPE}_64_lib.tar.gz iup-3.5_Linux${KTYPE}_64_lib.tar.gz" fi mkdir $PREFIX/iuplib for a in `echo $files` ; do if ! [[ -e $a ]] ; then