aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2010-11-29 14:00:55 +0100
committerSverker Eriksson <[email protected]>2010-11-29 14:00:55 +0100
commita583c16d79b3a5299ce1b5482f1fb0a88d845a51 (patch)
treebfae2d1afbb67d46395603ab9df64b270415e666 /erts/emulator/test
parent1cf74ffecc28bc620062cbff69620671f0927e9b (diff)
parent89d56a4e6fda65964f475fba58fbefec3825f9d9 (diff)
downloadotp-a583c16d79b3a5299ce1b5482f1fb0a88d845a51.tar.gz
otp-a583c16d79b3a5299ce1b5482f1fb0a88d845a51.tar.bz2
otp-a583c16d79b3a5299ce1b5482f1fb0a88d845a51.zip
Merge branch 'sverker/unsafe_CancelIoEx/OTP-8937' into dev
* sverker/unsafe_CancelIoEx/OTP-8937: Improve test case port_SUITE:close_deaf_port
Diffstat (limited to 'erts/emulator/test')
-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).