@@ -952,7 +952,8 @@ hibernate(Config) when is_list(Config) ->
952952 erlang :process_info (Pid , current_function )),
953953 receive
954954 {result ,R } ->
955- {current_function ,{erlang ,hibernate ,3 }} = R
955+ {current_function , MFA0 } = R ,
956+ true = is_hibernating_mfa (MFA0 )
956957 end ,
957958
958959 true = partisan_gen_server :call (my_test_name_hibernate , hibernate ),
@@ -1036,10 +1037,10 @@ is_in_erlang_hibernate_1(0, Pid) ->
10361037 ct :fail (not_in_erlang_hibernate_3 );
10371038is_in_erlang_hibernate_1 (N , Pid ) ->
10381039 {current_function ,MFA } = erlang :process_info (Pid , current_function ),
1039- case MFA of
1040- { erlang , hibernate , _Arity } ->
1040+ case is_hibernating_mfa ( MFA ) of
1041+ true ->
10411042 ok ;
1042- _ ->
1043+ false ->
10431044 receive after 10 -> ok end ,
10441045 is_in_erlang_hibernate_1 (N - 1 , Pid )
10451046 end .
@@ -1053,14 +1054,22 @@ is_not_in_erlang_hibernate_1(0, Pid) ->
10531054 ct :fail (not_in_erlang_hibernate_3 );
10541055is_not_in_erlang_hibernate_1 (N , Pid ) ->
10551056 {current_function ,MFA } = erlang :process_info (Pid , current_function ),
1056- case MFA of
1057- { erlang , hibernate , _Arity } ->
1057+ case is_hibernating_mfa ( MFA ) of
1058+ true ->
10581059 receive after 10 -> ok end ,
10591060 is_not_in_erlang_hibernate_1 (N - 1 , Pid );
1060- _ ->
1061+ false ->
10611062 ok
10621063 end .
10631064
1065+ % % Recognize a hibernating-process current_function. OTP 28's gen_server
1066+ % % hibernation parks the process inside its own `loop_hibernate/4' rather than
1067+ % % inside `erlang:hibernate/_' (which the test was originally written for).
1068+ is_hibernating_mfa ({erlang , hibernate , _ }) -> true ;
1069+ is_hibernating_mfa ({partisan_gen_server , loop_hibernate , _ }) -> true ;
1070+ is_hibernating_mfa ({gen_server , loop_hibernate , _ }) -> true ;
1071+ is_hibernating_mfa (_ ) -> false .
1072+
10641073% % --------------------------------------
10651074% % Test partisan_gen_server:abcast and handle_cast.
10661075% % Test all different return values from
@@ -1609,20 +1618,21 @@ undef_terminate2(Config) when is_list(Config) ->
16091618 ok = partisan_gen_server :stop (Server , {error , test }, infinity ),
16101619 ok = verify_down_reason (MRef , Server , {error , test }).
16111620
1612- % % Start should return an undef error if init isn't implemented
1621+ % % Start should return an undef error if init isn't implemented.
1622+ % % OTP 28 catches the undef inside start_link and returns the error
1623+ % % synchronously without ever fully spawning the server, so no `{'EXIT', _, _}'
1624+ % % message is delivered to the trap_exit caller.
16131625undef_init (_Config ) ->
16141626 {error , {undef , [{oc_init_server , init , [_ ], _ }|_ ]}} =
16151627 partisan_gen_server :start (oc_init_server , [], []),
16161628 process_flag (trap_exit , true ),
16171629 {error , {undef , [{oc_init_server , init , [_ ], _ }|_ ]}} =
16181630 (catch partisan_gen_server :start_link (oc_init_server , [], [])),
16191631 receive
1620- {'EXIT' , Server ,
1621- {undef , [{oc_init_server , init , [_ ], _ }|_ ]}} when is_pid (Server ) ->
1622- partisan :is_pid (Server ) orelse ct :fail ({bad_pid , Server }),
1623- ok
1624- after 1000 ->
1625- ct :fail (expected_exit_msg )
1632+ Msg ->
1633+ ct :fail ({unexpected_msg , Msg })
1634+ after 500 ->
1635+ ok
16261636 end .
16271637
16281638% % The upgrade should fail if code_change is expected in the callback module
0 commit comments