Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -284,12 +284,12 @@ ;; (let ((dbpath (db:dbfile-path run-id)) ;; (lockf (conc dbpath "/." run-id ".lck"))) ;; (common:simple-file-lock lockf) ;; (db:multi-db-sync (list run-id) 'new2old) ;; (common:simple-file-release-lock lockf)) - (let* ((dbpath (db:dbfile-path run-id)) - (lockf (conc dbpath "/." run-id ".lck")) + (let* ((dbpath (db:dbfile-path #f)) + (lockf (conc dbpath "/.megatest.lck")) (no-hurry (if *time-to-exit* ;; hurry up #f (begin (set! *time-to-exit* #t) #t)))) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -324,15 +324,17 @@ (define *time-zero* (current-seconds)) (define *watchdog* (make-thread (lambda () (thread-sleep! 0.05) ;; delay for startup - (let ((legacy-sync (common:legacy-sync-required)) - (debug-mode (debug:debug-mode 1)) - (last-time (current-seconds))) - (if legacy-sync - ;; (common:legacy-sync-recommended)) + (let* ((legacy-sync (common:legacy-sync-required)) + (debug-mode (debug:debug-mode 1)) + (last-time (current-seconds)) + (dbpath (db:dbfile-path #f)) + (lockf (conc dbpath "/.megatest.lck"))) + (if (or legacy-sync + (common:legacy-sync-recommended)) ;; for now do *some* syncing to megatest.db for backup purposes (let loop () ;; sync for filesystem local db writes ;; (let ((start-time (current-seconds)) (servers-started (make-hash-table))) @@ -341,11 +343,13 @@ (mutex-lock! *db-multi-sync-mutex*) (if (and legacy-sync (hash-table-ref/default *db-local-sync* run-id #f)) ;; (if (> (- start-time last-write) 5) ;; every five seconds (begin ;; let ((sync-time (- (current-seconds) start-time))) + (common:simple-file-lock lockf) (db:multi-db-sync (list run-id) 'new2old) + (common:simple-file-release-lock lockf) (if (common:low-noise-print 30 "sync new to old") (let ((sync-time (- (current-seconds) start-time))) (debug:print-info 0 "Sync of newdb to olddb for run-id " run-id " completed in " sync-time " seconds"))) ;; (if (> sync-time 10) ;; took more than ten seconds, start a server for this run ;; (begin @@ -363,11 +367,11 @@ ;; keep going unless time to exit ;; (if (not *time-to-exit*) (let delay-loop ((count 0)) (if (and (not *time-to-exit*) - (< count 11)) ;; aprox 5-6 seconds + (< count 40)) ;; aprox 30-40 seconds (begin (thread-sleep! 1) (delay-loop (+ count 1)))) (loop))) (if (common:low-noise-print 30) Index: mt.scm ================================================================== --- mt.scm +++ mt.scm @@ -145,10 +145,11 @@ (call-with-environment-variables (list (cons "MT_TEST_NAME" test-name) (cons "MT_TEST_RUN_DIR" test-rundir) (cons "MT_ITEMPATH" (db:test-get-item-path test-dat))) (lambda () + (runs:set-megatest-env-vars run-id) ;;; WARNING: This sets a lot of vars!!!! (push-directory test-rundir) (set! tconfig (mt:lazy-read-test-config test-name)) (for-each (lambda (trigger) (let ((cmd (configf:lookup tconfig "triggers" trigger)) (logf (conc test-rundir "/last-trigger.log")))