Fix eunit regression introduced in 2716d83a18

Use alternative way to detect net_kernel:stop/0 has succeeded as
suggested by Ulf Wiger.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/05505602
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/05505602
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/05505602

Branch: refs/heads/import
Commit: 0550560221fde6d5c19bec472e395fb20d720252
Parents: e840ac2
Author: Tuncer Ayaz <[email protected]>
Authored: Wed Aug 14 09:24:39 2013 +0200
Committer: Tuncer Ayaz <[email protected]>
Committed: Fri Sep 20 20:53:16 2013 +0200

----------------------------------------------------------------------
 src/rebar_eunit.erl | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/05505602/src/rebar_eunit.erl
----------------------------------------------------------------------
diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl
index 95ba3e8..d39b1a2 100644
--- a/src/rebar_eunit.erl
+++ b/src/rebar_eunit.erl
@@ -802,11 +802,11 @@ pause_until_net_kernel_stopped() ->
 pause_until_net_kernel_stopped(0) ->
     exit(net_kernel_stop_failed);
 pause_until_net_kernel_stopped(N) ->
-    try
-        timer:sleep(100),
-        pause_until_net_kernel_stopped(N - 1)
-    catch
-        error:badarg ->
+    case node() of
+        'nonode@nohost' ->
             ?DEBUG("Stopped net kernel.\n", []),
-            ok
+            ok;
+        _ ->
+            timer:sleep(100),
+            pause_until_net_kernel_stopped(N - 1)
     end.

Reply via email to