aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-10-15 09:53:53 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-10-15 09:53:53 +0200
commitdf2d13621f4b2ace33a460746e704115b7b1541e (patch)
treef67f7e4ad1bf819a398cc7c35efff44e69e4dddb /tests
parenta0e70b9d51812e1f8a22ef6bb0d1524c504c7324 (diff)
downloadcuirass-df2d13621f4b2ace33a460746e704115b7b1541e.tar
cuirass-df2d13621f4b2ace33a460746e704115b7b1541e.tar.gz
Use the writer worker for all write queries.
* .dir-locals.el: Add "with-queue-writer-worker". * bin/cuirass.in: Modify "with-queue-writer-worker" scope to include the web-server operations. * src/cuirass/database.scm (with-db-writer-worker-thread): Export it. (with-db-writer-worker-thread/force): New macro. (db-add-input, db-add-checkout, db-add-specification, db-remove-specification, db-add-evaluation, db-abort-pending-evaluations, db-set-evaluation-status, db-set-evaluation-time, db-add-output, db-add-build-product, db-add-event, db-delete-events-with-ids-<=-to): Use "with-db-writer-worker-thread" or "with-db-writer-worker-thread/force" instead of "with-db-worker-thread". * src/cuirass/metrics.scm (db-update-metrics): Ditto. * tests/database.scm ("db-init"): Set "%db-writer-channel". * tests/http.scm ("db-init"): Ditto. * tests/metrics.scm ("db-init"): Ditto.
Diffstat (limited to 'tests')
-rw-r--r--tests/database.scm1
-rw-r--r--tests/http.scm1
-rw-r--r--tests/metrics.scm1
3 files changed, 3 insertions, 0 deletions
diff --git a/tests/database.scm b/tests/database.scm
index a5083ca..73b347c 100644
--- a/tests/database.scm
+++ b/tests/database.scm
@@ -93,6 +93,7 @@
(%db-channel (make-worker-thread-channel
(lambda ()
(list (%db)))))
+ (%db-writer-channel (%db-channel))
#t))
(test-assert "sqlite-exec"
diff --git a/tests/http.scm b/tests/http.scm
index 23bfce6..e0ab840 100644
--- a/tests/http.scm
+++ b/tests/http.scm
@@ -114,6 +114,7 @@
(%db-channel (make-worker-thread-channel
(lambda ()
(list (%db)))))
+ (%db-writer-channel (%db-channel))
#t))
(test-assert "cuirass-run"
diff --git a/tests/metrics.scm b/tests/metrics.scm
index 48ee53a..b957d88 100644
--- a/tests/metrics.scm
+++ b/tests/metrics.scm
@@ -53,6 +53,7 @@
(%db-channel (make-worker-thread-channel
(lambda ()
(list (%db)))))
+ (%db-writer-channel (%db-channel))
#t))
(test-assert "sqlite-exec"