From 924e9db1d7d51834efdc255893c0d11417def679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 29 Mar 2016 13:30:26 +0200 Subject: 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. --- lib/stdlib/test/gen_fsm_SUITE.erl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/stdlib/test') 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. -- cgit v1.2.3