aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/port_SUITE.erl
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2010-11-29 13:57:15 +0100
committerSverker Eriksson <[email protected]>2010-11-29 13:57:15 +0100
commit89d56a4e6fda65964f475fba58fbefec3825f9d9 (patch)
treeff467d1995eb31ff90ab7f7104490a27228c03ca /erts/emulator/test/port_SUITE.erl
parentc5b7477a8873e6fd80fab598a8e63a5006e46621 (diff)
downloadotp-89d56a4e6fda65964f475fba58fbefec3825f9d9.tar.gz
otp-89d56a4e6fda65964f475fba58fbefec3825f9d9.tar.bz2
otp-89d56a4e6fda65964f475fba58fbefec3825f9d9.zip
Improve test case port_SUITE:close_deaf_port
Diffstat (limited to 'erts/emulator/test/port_SUITE.erl')
-rw-r--r--erts/emulator/test/port_SUITE.erl15
1 files changed, 7 insertions, 8 deletions
diff --git a/erts/emulator/test/port_SUITE.erl b/erts/emulator/test/port_SUITE.erl
index 6d89653623..93f9534138 100644
--- a/erts/emulator/test/port_SUITE.erl
+++ b/erts/emulator/test/port_SUITE.erl
@@ -2302,7 +2302,8 @@ load_driver(Dir, Driver) ->
end.
-close_deaf_port(doc) -> ["Send data to port program that does not read it, then close port."];
+close_deaf_port(doc) -> ["Send data to port program that does not read it, then close port."
+ "Primary targeting Windows to test threaded_handle_closer in sys.c"];
close_deaf_port(suite) -> [];
close_deaf_port(Config) when is_list(Config) ->
?line Dog = test_server:timetrap(test_server:seconds(100)),
@@ -2312,24 +2313,22 @@ close_deaf_port(Config) when is_list(Config) ->
?line erlang:port_command(Port,"Hello, can you hear me!?!?"),
?line port_close(Port),
- close_deaf_port_1(0, DeadPort).
+ Res = close_deaf_port_1(0, DeadPort),
+ ?line test_server:timetrap_cancel(Dog),
+ Res.
close_deaf_port_1(1000, _) ->
ok;
close_deaf_port_1(N, Cmd) ->
Timeout = integer_to_list(random:uniform(10*1000)),
- try open_port({spawn,Cmd++" "++Timeout},[]) of
+ ?line try open_port({spawn_executable,Cmd},[{args,[Timeout]}]) of
Port ->
?line erlang:port_command(Port,"Hello, can you hear me!?!?"),
?line port_close(Port),
close_deaf_port_1(N+1, Cmd)
catch
- exit:eagain ->
+ _:eagain ->
{comment, "Could not spawn more than " ++ integer_to_list(N) ++ " OS processes."}
end.
-repeat(0, _) -> ok;
-repeat(Cnt, Fun) ->
- Fun(),
- repeat(Cnt-1, Fun).