Skip to content

Commit 0ba936f

Browse files
author
Simon MacMullen
committed
Hypothesis: what's happening is some old channel_created event from a previous test is getting overtaken by the rabbit_tests_event_receiver starting up, and is thus getting through to us. Solution: ignore events with the wrong pid until we get the one we want.
1 parent 6bff599 commit 0ba936f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rabbit_tests.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,11 @@ expect_events(Pid, Type) ->
14711471
expect_event(Pid, Type).
14721472

14731473
expect_event(Pid, Type) ->
1474-
receive #event{type = Type, props = Props} -> Pid = pget(pid, Props)
1474+
receive #event{type = Type, props = Props} ->
1475+
case pget(pid, Props) of
1476+
Pid -> ok;
1477+
_ -> expect_event(Pid, Type)
1478+
end
14751479
after 1000 -> throw({failed_to_receive_event, Type})
14761480
end.
14771481

0 commit comments

Comments
 (0)