Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -1073,11 +1073,11 @@ (mutex-unlock! *incoming-mutex*) (if *cache-on* (debug:print 6 "INFO: *cache-on* is " *cache-on* ", skipping cache write") (db:write-cached-data))) -(define (cdb:tests-register-test run-id test-name item-path #!key (force-write #f)) +(define (cdb:tests-register-test db run-id test-name item-path #!key (force-write #f)) (let ((item-paths (if (equal? item-path "") (list item-path) (list item-path "")))) (debug:print 4 "INFO: Adding " run-id ", " test-name "/" item-path " for setting pass/fail counts to the queue") (mutex-lock! *incoming-mutex*) @@ -1648,19 +1648,19 @@ (port (vector-ref *runremote* 1))) ((rpc:procedure 'cdb:pass-fail-counts host port) test-id fail-count pass-count)) (cdb:pass-fail-counts test-id fail-count pass-count))) ;; currently forces a flush of the queue -(define (rdb:tests-register-test run-id test-name item-path) +(define (rdb:tests-register-test db run-id test-name item-path) (if *runremote* (let ((host (vector-ref *runremote* 0)) (port (vector-ref *runremote* 1))) - ((rpc:procedure 'cdb:tests-register-test host port) run-id test-name item-path force-write: #t)) - (cdb:tests-register-test run-id test-name item-path force-write: #t))) + ((rpc:procedure 'cdb:tests-register-test host port) db run-id test-name item-path force-write: #t)) + (cdb:tests-register-test db run-id test-name item-path force-write: #t))) (define (rdb:flush-queue) (if *runremote* (let ((host (vector-ref *runremote* 0)) (port (vector-ref *runremote* 1))) ((rpc:procedure 'cdb:flush-queue host port))) (cdb:flush-queue))) Index: server.scm ================================================================== --- server.scm +++ server.scm @@ -63,11 +63,11 @@ 'remote:run (lambda (procstr . params) (server:autoremote procstr params))) (rpc:publish-procedure! - 'serve:login + 'server:login (lambda (toppath) (set! *last-db-access* (current-seconds)) (if (equal? *toppath* toppath) (begin (debug:print 2 "INFO: login successful") @@ -103,13 +103,13 @@ (debug:print 4 "INFO: Remote call of cdb:pass-fail-counts " test-id " passes: " pass-count " fails: " fail-count) (cdb:pass-fail-counts test-id fail-count pass-count))) (rpc:publish-procedure! 'cdb:tests-register-test - (lambda (run-id test-name item-path) + (lambda (db run-id test-name item-path) (debug:print 4 "INFO: Remote call of cdb:tests-register-test " run-id " testname: " test-name " item-path: " item-path) - (cdb:tests-register-test run-id test-name item-path))) + (cdb:tests-register-test db run-id test-name item-path))) (rpc:publish-procedure! 'cdb:flush-queue (lambda () (debug:print 4 "INFO: Remote call of cdb:flush-queue") @@ -195,14 +195,14 @@ ;; (lambda (db . param) ;; (sqlite3:execute db "DELETE FROM metadat WHERE var='SERVER'")) ;; #f) (set! *runremote* #f)) (if (and (not (args:get-arg "-server")) ;; no point in the server using the server using the server - ((rpc:procedure 'serve:login host portn) *toppath*)) + ((rpc:procedure 'server:login host portn) *toppath*)) (begin (debug:print 2 "INFO: Connected to " host ":" port) (set! *runremote* (vector host portn))) (begin (debug:print 2 "INFO: Failed to connect to " host ":" port) (set! *runremote* #f))))) (debug:print 2 "INFO: no server available"))))) Index: tests/tests.scm ================================================================== --- tests/tests.scm +++ tests/tests.scm @@ -190,17 +190,18 @@ ;;====================================================================== ;; R E M O T E C A L L S ;;====================================================================== ;; start a server process -(define server-pid (process-run "../../bin/megatest" '("-server" "-" "-debug" "10"))) +(set! *verbosity* 10) +(define server-pid (process-run "../../bin/megatest" (list "-server" "-" "-debug" (conc *verbosity*)))) (sleep 2) (define start-wait (current-seconds)) (server:client-setup) -;; (set! *verbosity* 10) +(print "Starting intensive cache and rpc test") (for-each (lambda (params) - (rdb:tests-register-test 1 (conc "test" (random 20)) "") + ;;; (rdb:tests-register-test #f 1 (conc "test" (random 20)) "") (apply rdb:test-set-status-state test-id params) (rdb:pass-fail-counts test-id (random 100) (random 100)) (rdb:test-rollup-iterated-pass-fail test-id) (thread-sleep! 0.01)) ;; cache ordering granularity is at the second level. Should really be at the ms level '(("COMPLETED" "PASS" #f)