Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update test/bunny_farm_tests.erl

  • Loading branch information...
commit a297d9fb57882af5f8cfe2c8acd6aebd21aeaaeb 1 parent 89981ef
@seanmcevoy seanmcevoy authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 test/bunny_farm_tests.erl
View
15 test/bunny_farm_tests.erl
@@ -56,3 +56,18 @@ encoding_none_test() ->
bunny_farm:close(SubBus, ConsumerTag),
bunny_farm:close(PubBus),
?assertEqual(<<"dummy payload">>, Act).
+
+resource_cleanup_test() ->
+ Ports1 = length(erlang:ports()),
+ Procs1 = length(processes()),
+ BusA = bunny_farm:open({<<"dummy.exchange">>, [{encoding, none}]}),
+ BusB = bunny_farm:open(<<"">>),
+ Ports2 = length(erlang:ports()),
+ Procs2 = length(processes()),
+ bunny_farm:close(BusA),
+ bunny_farm:close(BusB),
+ true = Ports2 > Ports1,
+ true = Procs2 > Procs1,
+ timer:sleep(100), % asynchronous shutdown somewhere
+ Ports1 = length(erlang:ports()),
+ Procs1 = length(processes()).
Please sign in to comment.
Something went wrong with that request. Please try again.