test: trap exit to assert gen_server:start_link returns error tuple

otherwise it will raise an exit exception
This commit is contained in:
Zaiming (Stone) Shi 2023-12-14 13:23:54 +01:00
parent 8a425d09bc
commit 8d90f6f067
1 changed files with 1 additions and 0 deletions

View File

@ -125,6 +125,7 @@ t_bad_messages(Config) ->
). ).
t_nonexistent_file(_Config) -> t_nonexistent_file(_Config) ->
erlang:process_flag(trap_exit, true),
?assertEqual( ?assertEqual(
{error, enoent}, {error, enoent},
emqx_ft_storage_fs_reader:start_link(self(), "/a/b/c/bar") emqx_ft_storage_fs_reader:start_link(self(), "/a/b/c/bar")