diff options
-rwxr-xr-x | test/etap/040-util.t | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/test/etap/040-util.t b/test/etap/040-util.t index e311adab..f2033060 100755 --- a/test/etap/040-util.t +++ b/test/etap/040-util.t @@ -17,9 +17,7 @@ main(_) -> code:add_pathz("src/couchdb"), application:start(crypto), - % Changed to 9 till we figure out the buildbot freeze. - %etap:plan(10), - etap:plan(9), + etap:plan(10), case (catch test()) of ok -> etap:end_tests(); @@ -40,18 +38,25 @@ test() -> % terminate_linked Self = self(), - % This is causing halts on the buildbot make coverage runner. - % Im disabling until we get build bot running but we need to - % revisit this. - %spawn(fun() -> - % ChildPid = spawn_link(fun() -> receive shutdown -> ok end end), - % couch_util:terminate_linked(normal), - % Self ! {pid, ChildPid} - %end), - %receive - % {pid, Pid} -> - % etap:ok(not is_process_alive(Pid), "why wont this work?") - %end, + spawn(fun() -> + SecondSelf = self(), + ChildPid = spawn_link(fun() -> + SecondSelf ! {child, started}, + receive shutdown -> ok end + end), + PidUp = receive + {child, started} -> ok + after 1000 -> + {error, timeout} + end, + etap:is(ok, PidUp, "Started a linked process."), + couch_util:terminate_linked(normal), + Self ! {pid, ChildPid} + end), + receive + {pid, Pid} -> + etap:ok(not is_process_alive(Pid), "Linked process was killed.") + end, % implode etap:is([1, 38, 2, 38, 3], couch_util:implode([1,2,3],"&"), |