summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-08-19 12:30:55 +0100
committerSimon MacMullen <simon@rabbitmq.com>2011-08-19 12:30:55 +0100
commit0ba936f4051a437866bd1d0bcb3d2e806c42cf48 (patch)
tree2c7c0d5255cb887e06eb84abe332158ae71dfff0
parent6bff5992e8914134810509da1b248015efe03e3b (diff)
downloadrabbitmq-server-git-0ba936f4051a437866bd1d0bcb3d2e806c42cf48.tar.gz
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.
-rw-r--r--src/rabbit_tests.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl
index bbca55b433..cd5d9be0cc 100644
--- a/src/rabbit_tests.erl
+++ b/src/rabbit_tests.erl
@@ -1471,7 +1471,11 @@ expect_events(Pid, Type) ->
expect_event(Pid, Type).
expect_event(Pid, Type) ->
- receive #event{type = Type, props = Props} -> Pid = pget(pid, Props)
+ receive #event{type = Type, props = Props} ->
+ case pget(pid, Props) of
+ Pid -> ok;
+ _ -> expect_event(Pid, Type)
+ end
after 1000 -> throw({failed_to_receive_event, Type})
end.