aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2010-12-15 14:23:51 +0100
committerBjörn-Egil Dahlberg <[email protected]>2010-12-15 14:23:51 +0100
commitf7eaaee444b6d785bd2a9dbb86e96e6db0c04b4d (patch)
treec3546679d29d681cb3eb68371650280dd0741d72 /lib/kernel
parent9f4dd4934d427f0fb2caeb034115e0227cc4610a (diff)
parent87e1cd1fc5324103810bfdda07f7dd9df0727359 (diff)
downloadotp-f7eaaee444b6d785bd2a9dbb86e96e6db0c04b4d.tar.gz
otp-f7eaaee444b6d785bd2a9dbb86e96e6db0c04b4d.tar.bz2
otp-f7eaaee444b6d785bd2a9dbb86e96e6db0c04b4d.zip
Merge branch 'egil/fix-distribution-testcase' into dev
* egil/fix-distribution-testcase: kernel: fix faulty distribution testcase
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/test/erl_distribution_SUITE.erl25
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl
index 21a96f804a..a215ec3608 100644
--- a/lib/kernel/test/erl_distribution_SUITE.erl
+++ b/lib/kernel/test/erl_distribution_SUITE.erl
@@ -845,13 +845,16 @@ monitor_nodes_otp_6481_test(Config, TestType) when is_list(Config) ->
?line {ok, Node} = start_node(Name, "", this),
?line receive {nodeup, Node} -> ok end,
- ?line spawn(Node,
+ ?line RemotePid = spawn(Node,
fun () ->
- receive after 1000 -> ok end,
- lists:foreach(fun (No) ->
- Me ! {NodeMsg, No}
- end,
- Seq),
+ receive after 1500 -> ok end,
+ % infinit loop of msgs
+ % we want an endless stream of messages and the kill
+ % the node mercilessly.
+ % We then want to ensure that the nodedown message arrives
+ % last ... without garbage after it.
+ Pid = spawn(fun() -> node_loop_send(Me, NodeMsg, 1) end),
+ receive {Me, kill_it} -> ok end,
halt()
end),
@@ -860,9 +863,11 @@ monitor_nodes_otp_6481_test(Config, TestType) when is_list(Config) ->
%% Verify that '{nodeup, Node}' comes before '{NodeMsg, 1}' (the message
%% bringing up the connection).
- %%?line no_msgs(500), % Why wait? It fails test sometimes /sverker
+ ?line no_msgs(500),
?line {nodeup, Node} = receive Msg1 -> Msg1 end,
- ?line {NodeMsg, 1} = receive Msg2 -> Msg2 end,
+ ?line {NodeMsg, 1} = receive Msg2 -> Msg2 end,
+ % msg stream has begun, kill the node
+ ?line RemotePid ! {self(), kill_it},
%% Verify that '{nodedown, Node}' comes after the last '{NodeMsg, N}'
%% message.
@@ -883,6 +888,10 @@ flush_node_msgs(NodeMsg, No) ->
OtherMsg -> OtherMsg
end.
+node_loop_send(Pid, Msg, No) ->
+ Pid ! {Msg, No},
+ node_loop_send(Pid, Msg, No + 1).
+
monitor_nodes_errors(doc) ->
[];
monitor_nodes_errors(suite) ->