We don't need to verify that erlang:garbage_collect() works 1889/head
authorRobert Newson <rnewson@apache.org>
Fri, 1 Feb 2019 17:49:10 +0000 (17:49 +0000)
committerRobert Newson <rnewson@apache.org>
Fri, 1 Feb 2019 17:49:10 +0000 (17:49 +0000)
src/mango/src/mango_native_proc.erl

index 86a5dc1..ab16146 100644 (file)
@@ -367,22 +367,7 @@ validate_index_info(IndexInfo) ->
 -include_lib("eunit/include/eunit.hrl").
 
 handle_garbage_collect_cast_test() ->
-    Pid = self(),
-    {_, TracerRef} = spawn_monitor(fun() ->
-        erlang:trace(Pid, true, [garbage_collection]),
-        receive {trace, Pid, gc_start, _} ->
-            erlang:trace(Pid, false, [garbage_collection]),
-            exit(gc_start)
-        end
-    end),
-    erlang:yield(),
-    ?assertEqual({noreply, []}, handle_cast(garbage_collect, [])),
-    receive
-        {'DOWN', TracerRef, _, _, Msg} -> ?assertEqual(gc_start, Msg)
-    after 10000 ->
-        erlang:error({assertion_failed, [{module, ?MODULE}, {line, ?LINE},
-            {expected, gc_start}, {reason, timeout}]})
-    end.
+    ?assertEqual({noreply, []}, handle_cast(garbage_collect, [])).
 
 handle_stop_cast_test() ->
     ?assertEqual({stop, normal, []}, handle_cast(stop, [])).