diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-11 01:28:58 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-11 01:28:58 -0300 |
| commit | cc0b15c84de8b866cccd8b660b0ce0afcfba3d98 (patch) | |
| tree | 0ec0ebc7c4a575802453fb9b2c1a428fda750778 /test/unit/kernel/Session.ml | |
| parent | 470491974d1498a1982a4e4b3560370bdf3d8c27 (diff) | |
| download | RNT-cc0b15c84de8b866cccd8b660b0ce0afcfba3d98.tar.gz RNT-cc0b15c84de8b866cccd8b660b0ce0afcfba3d98.zip | |
tests and some pointer for program on ephemeral
Diffstat (limited to '')
| -rw-r--r-- | test/unit/kernel/Session.ml | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/test/unit/kernel/Session.ml b/test/unit/kernel/Session.ml index 79ad5a2..edb22c4 100644 --- a/test/unit/kernel/Session.ml +++ b/test/unit/kernel/Session.ml @@ -25,7 +25,7 @@ module Make (S : Abstract.Storage.STORAGE) (C : Helpers.Storage.CONFIGURATOR) = let* _ = update root ("system" @/ "branch" @/ this) "client" None (Some branch) in let* tip = address branch in let session = Session.make conn {Protocols.Session.snapshot= tip} in - let* _ = update root ("system" @/ "session" @/ this) "client" None (Some session) in + let* _ = update root ("system" @/ "session" @/ this) "client" None (Protocols.Handle.copy session) in let library = "system" @/ "session" @/ "client" @/ "branch" @/ "multigroup" @/ "library" @/ this in @@ -55,32 +55,9 @@ module Make (S : Abstract.Storage.STORAGE) (C : Helpers.Storage.CONFIGURATOR) = check bool "the session reconstructs the pinned branch" true pinned; check bool "the session refuses derivation through it" true refused - let single_handle conn = - let refused, reacquired = - begin - let open Utilities.Result in - let open Rnt.Kernel.Path in - let* root = I.initialize conn in - let* branch = B.make conn in - let* tip = address branch in - let session = Session.make conn {Protocols.Session.snapshot= tip} in - let* _ = update root ("system" @/ "session" @/ this) "client" None (Some session) in - let client = "system" @/ "session" @/ "client" @/ this in - let* _ = lookup root ("system" @/ "session" @/ "client" @/ "branch" @/ this) in - let* held = lookup root client in - let refused = finds root client in - Protocols.Handle.release held; - Ok (refused, finds root client) - end - |> Helpers.condition_as_failure - in - check bool "a second handle to the session is refused" false refused; - check bool "releasing the handle frees the session" true reacquired - let suite = ( "kernel/session", - [ test_case "pin-and-follow" `Quick (H.with_connection pin_and_follow "session-test"); - test_case "single-handle" `Quick (H.with_connection single_handle "session-single-test") ] ) + [test_case "pin-and-follow" `Quick (H.with_connection pin_and_follow "session-test")] ) end module LMDB = Make (Rnt.Backend.Storage.LMDB) (Helpers.Storage.LMDB_Configurator) |
