aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/driver_SUITE.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2015-10-15 11:53:24 +0200
committerLukas Larsson <[email protected]>2015-12-15 10:05:47 +0100
commit638476d255cf6f9e5cd880eb9318d5b08664e5f8 (patch)
treee067951b1678ffd50bbe87d5c13ceb2b354b4cef /erts/emulator/test/driver_SUITE.erl
parent6fc7ccb41da5e9ec4357b40811ad740dd6a3b5b2 (diff)
downloadotp-638476d255cf6f9e5cd880eb9318d5b08664e5f8.tar.gz
otp-638476d255cf6f9e5cd880eb9318d5b08664e5f8.tar.bz2
otp-638476d255cf6f9e5cd880eb9318d5b08664e5f8.zip
erts: Allow one dangling fd if there is a gethost port
Diffstat (limited to 'erts/emulator/test/driver_SUITE.erl')
-rw-r--r--erts/emulator/test/driver_SUITE.erl26
1 files changed, 24 insertions, 2 deletions
diff --git a/erts/emulator/test/driver_SUITE.erl b/erts/emulator/test/driver_SUITE.erl
index b72d6cbe52..e17d0ff96c 100644
--- a/erts/emulator/test/driver_SUITE.erl
+++ b/erts/emulator/test/driver_SUITE.erl
@@ -2395,13 +2395,35 @@ z_test(Config) when is_list(Config) ->
check_io_debug() ->
get_stable_check_io_info(),
- {NoErrorFds, NoUsedFds, NoDrvSelStructs, NoDrvEvStructs}
+ {NoErrorFds, NoUsedFds, NoDrvSelStructs, NoDrvEvStructs} = CheckIoDebug
= erts_debug:get_internal_state(check_io_debug),
+ HasGetHost = has_gethost(),
+ ct:log("check_io_debug: ~p~n"
+ "HasGetHost: ~p",[CheckIoDebug, HasGetHost]),
0 = NoErrorFds,
- NoUsedFds = NoDrvSelStructs,
+ if
+ NoUsedFds == NoDrvSelStructs ->
+ ok;
+ HasGetHost andalso (NoUsedFds == (NoDrvSelStructs - 1)) ->
+ %% If the inet_gethost port is alive, we may have
+ %% one extra used fd that is not selected on
+ ok
+ end,
0 = NoDrvEvStructs,
ok.
+has_gethost() ->
+ has_gethost(erlang:ports()).
+has_gethost([P|T]) ->
+ case erlang:port_info(P, name) of
+ {name,"inet_gethost"++_} ->
+ true;
+ _ ->
+ has_gethost(T)
+ end;
+has_gethost([]) ->
+ false.
+
%flush_msgs() ->
% receive
% M ->