okami.mom/albedo
git clone https://git.nkp.pet/okami.mom/albedo
1b24e0e
main
1//// A store query waits for its answer with no deadline, so a store that stops 2//// must end the wait at once. A daemon run never stops its store under a 3//// waiting caller, so only this test sees a hang there. 4 5import albedo/daemon/store 6import gleam/erlang/process 7 8pub fn a_query_on_a_stopped_store_fails_at_once_test () -> Nil { 9let assert Ok ( db ) = store . start ( ":memory:" , "" ) 10store . close ( db ) 11let caller = 12process . spawn_unlinked ( fn () { 13store . query ( db , fn ( _ ) { Nil }) 14Nil 15}) 16let monitor = process . monitor ( caller ) 17let assert Ok ( _ ) = 18process . new_selector () 19|> process . select_specific_monitor ( monitor , fn ( down ) { down }) 20|> process . selector_receive ( 1000 ) 21as "the caller is still waiting on a stopped store" 22Nil 23}