aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-03-29 13:30:26 +0200
committerBjörn Gustavsson <[email protected]>2016-03-30 14:29:54 +0200
commit924e9db1d7d51834efdc255893c0d11417def679 (patch)
treea00c87b68ef0c947cbdccb70924ba63a7466464e
parent272b962f3ddc62f7c67f3558e0f9cd503f920642 (diff)
downloadotp-924e9db1d7d51834efdc255893c0d11417def679.tar.gz
otp-924e9db1d7d51834efdc255893c0d11417def679.tar.bz2
otp-924e9db1d7d51834efdc255893c0d11417def679.zip
gen_fsm_SUITE: Make abnormal1/1 stop failing
abnormal1/1 started failing sporadically when 22785cd1e21 changed using the messages_get/0 and using its own implementation: get_messages() -> receive Msg -> [Msg|get_messages()] after 1 -> [] end. In test_server:messages_get/0, there was "after 0" instead of "after 1" as in this version. We could change back to using "after 0", but it seems that the test case just happened to work before the change. Instead, read out the message that is guranteed to be in the message queue, and *then* check that the message queue is empty.
-rw-r--r--lib/stdlib/test/gen_fsm_SUITE.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/stdlib/test/gen_fsm_SUITE.erl b/lib/stdlib/test/gen_fsm_SUITE.erl
index d0f5c55826..e23e747dee 100644
--- a/lib/stdlib/test/gen_fsm_SUITE.erl
+++ b/lib/stdlib/test/gen_fsm_SUITE.erl
@@ -391,6 +391,12 @@ abnormal1(Config) when is_list(Config) ->
delayed = gen_fsm:sync_send_event(my_fsm, {delayed_answer,1}, 100),
{'EXIT',{timeout,_}} =
(catch gen_fsm:sync_send_event(my_fsm, {delayed_answer,10}, 1)),
+ receive
+ Msg ->
+ %% Ignore the delayed answer from the server.
+ io:format("Delayed message: ~p", [Msg])
+ end,
+
[] = get_messages(),
ok.