Skip to content

Commit 2c2ea97

Browse files
committed
Merge pull request atomvm#2130 from pguyot/w08/test_gen_server_flaky_fix
Fix test_gen_server flappiness These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 7783d2a + 0a8ec49 commit 2c2ea97

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/libs/estdlib/test_gen_server.erl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,9 @@ test_late_reply() ->
282282
test_concurrent_clients() ->
283283
{ok, Pid} = gen_server:start(?MODULE, [], []),
284284
Self = self(),
285-
P1 = spawn(fun() -> make_requests(Pid, Self, 1, 1000) end),
286-
P2 = spawn(fun() -> make_requests(Pid, Self, 10, 100) end),
287-
P3 = spawn(fun() -> make_requests(Pid, Self, 20, 50) end),
285+
P1 = spawn(fun() -> make_requests(Pid, Self, 1, 50) end),
286+
P2 = spawn(fun() -> make_requests(Pid, Self, 10, 10) end),
287+
P3 = spawn(fun() -> make_requests(Pid, Self, 20, 5) end),
288288
wait_for(P1),
289289
wait_for(P2),
290290
wait_for(P3),
@@ -302,6 +302,7 @@ make_requests(Pid, Waiting, ReplyAfter, I) ->
302302
wait_for(P) ->
303303
receive
304304
P -> ok
305+
after 30000 -> error({timeout_waiting_for, P})
305306
end.
306307

307308
test_timeout_call() ->

0 commit comments

Comments
 (0)