diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-08-19 12:30:55 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-08-19 12:30:55 +0100 |
commit | 2cafe7eb2f135bca631d150b1d70600e827326a6 (patch) | |
tree | 2c7c0d5255cb887e06eb84abe332158ae71dfff0 | |
parent | f350f2fd8b29e9f032eaa1ead0caa7bffc792057 (diff) | |
download | rabbitmq-server-bug24354.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.bug24354
-rw-r--r-- | src/rabbit_tests.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl index bbca55b4..cd5d9be0 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. |