AtlatestRepositoryfolio

folio / tree / test / fixtureshold-store-lock.sgl

1;;; Hold a real writer lock until the test publishes its release marker.
2(import (sigil fs)
3 (sigil process)
4 (sigil time)
5 (folio store)
6 (folio lock))
7
8(let* ((store (make-folio-store (getenv "FOLIO_LOCK_TEST_ROOT")))
9 (ready (getenv "FOLIO_LOCK_TEST_READY"))
10 (release (getenv "FOLIO_LOCK_TEST_RELEASE")))
11 (call-with-store-lock store
12 (lambda ()
13 (write-file-string ready "held\n")
14 (let loop ()
15 (unless (file-exists? release)
16 (sleep 0.02)
17 (loop))))))