Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
8103-erpc-tests-for-always_spawn.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 8103-erpc-tests-for-always_spawn.patch of Package erlang
From e5eb2528a19967d7443590145ebc993fd28a6bf7 Mon Sep 17 00:00:00 2001 From: Jan Uhlig <juhlig@hnc-agency.org> Date: Tue, 27 Aug 2024 10:33:59 +0200 Subject: [PATCH 3/3] erpc tests for always_spawn --- lib/kernel/test/erpc_SUITE.erl | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/lib/kernel/test/erpc_SUITE.erl b/lib/kernel/test/erpc_SUITE.erl index ea749b54e8..d67cf33cb8 100644 --- a/lib/kernel/test/erpc_SUITE.erl +++ b/lib/kernel/test/erpc_SUITE.erl @@ -21,7 +21,8 @@ -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, init_per_group/2,end_per_group/2]). --export([call/1, call_reqtmo/1, call_against_old_node/1, cast/1, +-export([call/1, call_reqtmo/1, call_against_old_node/1, + call_always_spawn/1, cast/1, send_request/1, send_request_fun/1, send_request_receive_reqtmo/1, send_request_wait_reqtmo/1, @@ -36,6 +37,7 @@ multicall_recv_opt/1, multicall_recv_opt2/1, multicall_recv_opt3/1, + multicall_always_spawn/1, multicast/1, timeout_limit/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -52,6 +54,7 @@ all() -> [call, call_reqtmo, call_against_old_node, + call_always_spawn, cast, send_request, send_request_fun, @@ -80,6 +83,7 @@ all() -> multicall_recv_opt, multicall_recv_opt2, multicall_recv_opt3, + multicall_always_spawn, multicast, timeout_limit]. @@ -467,6 +471,19 @@ reqtmo_test(Test) -> "Timeout = " ++ integer_to_list(Timeout) ++ " Actual = " ++ integer_to_list(Time)}. +call_always_spawn(Config) when is_list(Config) -> + case self() =:= erpc:call(node(), erlang, self, [], + #{timeout => infinity, + always_spawn => false}) of + true -> + false = self() =:= erpc:call(node(), erlang, self, [], + #{timeout => infinity, + always_spawn => true}), + ok; + false -> + {skip, local_call_spawned} + end. + cast(Config) when is_list(Config) -> %% silently fail ok = erpc:cast(badnodename, erlang, send, [hej]), @@ -1732,6 +1749,21 @@ do_time_multicall(Expect, Nodes, Fun, Tmo, N) -> Expect = erpc:multicall(Nodes, Fun, Tmo), do_time_multicall(Expect, Nodes, Fun, Tmo, N-1). +multicall_always_spawn(Config) when is_list(Config) -> + Replies1 = erpc:multicall([node(), node()], erlang, self, [], + #{timeout => infinity, + always_spawn => false}), + case lists:any(fun({ok, Pid}) -> self() =:= Pid end, Replies1) of + true -> + Replies2 = erpc:multicall([node(), node()], erlang, self, [], + #{timeout => infinity, + always_spawn => true}), + false = lists:any(fun({ok, Pid}) -> self() =:= Pid end, Replies2), + ok; + false -> + {skip, all_local_calls_spawned} + end. + multicast(Config) when is_list(Config) -> {ok, Node} = start_node(Config), Nodes = [node(), Node], -- 2.43.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor