okami.mom/albedo
git clone https://git.nkp.pet/okami.mom/albedo
61c43ca
main
1%% Exact exception classification cannot be asserted through HTTP: application 2%% panics and disappearing actor handles must have different failure behavior. 3- module ( albedo_daemon_request_test ). 4- include_lib ( "eunit/include/eunit.hrl" ). 5 6closed_actor_calls_are_unavailable_test () -> 7lists : foreach ( fun ( Message ) -> 8Reason = # { module =><< "gleam/erlang/process" >>, 9function =><< "perform_call" >>, message =>Message }, 10 ?assertEqual ({ error , nil }, albedo_daemon : http_request ( fun () -> 11erlang : error ( Reason ) 12end )) 13end , [<< "callee exited: ProcessDown(..., Normal)" >>, 14<< "Callee subject had no owner" >>, 15<< "callee did not send reply before timeout" >>]). 16 17unrelated_errors_keep_their_reason_test () -> 18Reasons = [ # { module =><< "application" >>, function =><< "perform_call" >>, 19message =><< "callee exited: unrelated application error" >>}, 20# { module =><< "gleam/erlang/process" >>, 21function =><< "perform_call" >>, 22message =><< "callee did not send reply before timeout: application error" >>}, 23# { module =><< "gleam/erlang/process" >>, 24function =><< "application_call" >>, 25message =><< "callee did not send reply before timeout" >>}, 26application_bug ], 27lists : foreach ( fun ( Reason ) -> 28 ?assertException ( error , Reason , albedo_daemon : http_request ( fun () -> 29erlang : error ( Reason ) 30end )) 31end , Reasons ), 32 ?assertException ( throw , application_bug , albedo_daemon : http_request ( fun () -> 33throw ( application_bug ) 34end )). 35 36ordinary_responses_pass_through_test () -> 37 ?assertEqual ({ ok , response }, albedo_daemon : http_request ( fun () -> response end )).