Index: dashboard-tests.scm ================================================================== --- dashboard-tests.scm +++ dashboard-tests.scm @@ -268,11 +268,11 @@ (logfile "/this/dir/better/not/exist") (rundir logfile) (testfullname (if testdat (db:test-get-fullname testdat) "Gathering data ...")) (testname (if testdat (db:test-get-testname testdat) "n/a")) (testmeta (if testdat - (let ((tm (rdb:testmeta-get-record db testname))) + (let ((tm (db:testmeta-get-record db testname))) (if tm tm (make-db:testmeta))) (make-db:testmeta))) (keystring (string-intersperse (map (lambda (keyval) Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -436,12 +436,23 @@ (if itempatt itempatt "%")) res)) ;; this one is a bit broken BUG FIXME (define (db:delete-test-step-records db run-id test-name itemdat) - (sqlite3:execute db "DELETE FROM test_steps WHERE test_id in (SELECT id FROM tests WHERE run_id=? AND testname=? AND item_path=?);" - run-id test-name (item-list->path itemdat))) + ;; Breaking it into two queries for better file access interleaving + (let ((ids '())) + (sqlite3:for-each-row (lambda (id) + (set! ids (cons id ids))) + db + "SELECT id FROM tests WHERE run_id=? AND testname=? AND item_path=?;" + run-id test-name (item-list->path itemdat)) + (for-each (lambda (id) + (sqlite3:execute db "DELETE FROM test_steps WHERE test_id=?;" id) + (thread-sleep! 0.1)) ;; give others access to the db + ids))) +;;"DELETE FROM test_steps WHERE test_id in (SELECT id FROM tests WHERE run_id=? AND testname=? AND item_path=?);" + ;; (define (db:delete-test-records db test-id) (sqlite3:execute db "DELETE FROM test_steps WHERE test_id=?;" test-id) (sqlite3:execute db "DELETE FROM test_data WHERE test_id=?;" test-id) (sqlite3:execute db "DELETE FROM tests WHERE id=?;" test-id)) @@ -627,11 +638,11 @@ ;; QUEUE UP META, TEST STATUS AND STEPS ;;====================================================================== (define (db:updater db) (let loop ((start-time (current-time))) - (thread-sleep! (+ 2 (random 10))) ;; move save time around to minimize regular collisions + (thread-sleep! 0.5) ;; move save time around to minimize regular collisions? (db:write-cached-data db) (loop start-time))) (define (db:test-update-meta-info db run-id test-name item-path minutes cpuload diskfree tmpfree) (if (not item-path) @@ -982,10 +993,11 @@ (current-seconds) ;; FIXME - this should not update the logfile unless it is specified. (list test-id teststep-name state-in status-in (current-seconds) (if comment comment "") (if logfile logfile ""))) *incoming-data*)) (mutex-unlock! *incoming-mutex*) + (if (not *cache-on*)(db:write-cached-data db)) #t) (debug:print 0 "ERROR: Can't update " test-name " for run " run-id " -> no such test in db")))) ;;====================================================================== ;; Extract ods file from the db Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -92,10 +92,11 @@ (exit 1))) ;; now can find our db (set! db (open-db)) (if (not (args:get-arg "-server")) (server:client-setup db)) + (set! *cache-on* #t) (set-megatest-env-vars db run-id) ;; these may be needed by the launching process (change-directory work-area) (set-run-config-vars db run-id) ;; environment overrides are done *before* the remaining critical envars. (alist->env-vars env-ovrd) Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -616,15 +616,15 @@ ;; Rollup runs ;;====================================================================== ;; Update the test_meta table for this test (define (runs:update-test_meta db test-name test-conf) - (let ((currrecord (rdb:testmeta-get-record db test-name))) + (let ((currrecord (db:testmeta-get-record db test-name))) (if (not currrecord) (begin (set! currrecord (make-vector 10 #f)) - (rdb:testmeta-add-record db test-name))) + (db:testmeta-add-record db test-name))) (for-each (lambda (key) (let* ((idx (cadr key)) (fld (car key)) (val (config-lookup test-conf "test_meta" fld)))