Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -1188,12 +1188,13 @@ (set! res #f)))) ;; overrides -no-cache switch res)) ;; force use of server? ;; +(define *common:local-force-server* #f) (define (common:force-server?) - (let* ((force-setting (configf:lookup *configdat* "server" "force")) + (let* ((force-setting (or *common:local-force-server* (configf:lookup *configdat* "server" "force"))) (force-type (if force-setting (string->symbol force-setting) #f)) (force-result (case force-type ((#f) #f) ((always) #t) ((test) (if (args:get-arg "-execute") ;; we are in a test Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -1316,11 +1316,20 @@ ;; 3. create link from run dir to megatest runs area ;; 4. remotely run the test on allocated host ;; - could be ssh to host from hosts table (update regularly with load) ;; - could be netbatch ;; (launch-test db (cadr status) test-conf)) -(define (launch-test test-id run-id run-info keyvals runname test-conf test-name test-path itemdat params) + +(define (launch-test . args) + (let ((child-pid (process-fork))) + (if (zero? child-pid) + (begin + (set! *common:local-force-server* 'always) + (apply launch-test-inner args)) + #t))) + +(define (launch-test-inner test-id run-id run-info keyvals runname test-conf test-name test-path itemdat params) (mutex-lock! *launch-setup-mutex*) ;; setting variables and processing the testconfig is NOT thread-safe, reuse the launch-setup mutex (let* ( ;; (lock-key (conc "test-" test-id)) ;; (got-lock (let loop ((lock (rmt:no-sync-get-lock lock-key)) ;; (expire-time (+ (current-seconds) 15))) ;; give up on getting the lock and steal it after 15 seconds ;; (if (car lock)