diff options
author | Björn Gustavsson <[email protected]> | 2011-09-26 14:49:28 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-09-26 14:49:28 +0200 |
commit | ab017dce9a19f2fcd470c85f562122aac161b466 (patch) | |
tree | afb01b1565a6d7ee35e77154fc096a8fd061c42e /erts/emulator/test | |
parent | 97f3a064f27843a9f825210c1c7a27075b7b3ad7 (diff) | |
download | otp-ab017dce9a19f2fcd470c85f562122aac161b466.tar.gz otp-ab017dce9a19f2fcd470c85f562122aac161b466.tar.bz2 otp-ab017dce9a19f2fcd470c85f562122aac161b466.zip |
busy_port_SUITE: Avoid crash in register/2
Add an end_per_testcase/2 function to ensure that the process with
the name 'busy_drv_server' has been killed before the next test
case attempts to register a process with the same name.
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/busy_port_SUITE.erl | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/erts/emulator/test/busy_port_SUITE.erl b/erts/emulator/test/busy_port_SUITE.erl index 8365e1c540..dac2a70f59 100644 --- a/erts/emulator/test/busy_port_SUITE.erl +++ b/erts/emulator/test/busy_port_SUITE.erl @@ -20,7 +20,7 @@ -module(busy_port_SUITE). -export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, - init_per_group/2,end_per_group/2, + init_per_group/2,end_per_group/2,end_per_testcase/2, io_to_busy/1, message_order/1, send_3/1, system_monitor/1, no_trap_exit/1, no_trap_exit_unlinked/1, trap_exit/1, multiple_writers/1, @@ -53,6 +53,20 @@ init_per_group(_GroupName, Config) -> end_per_group(_GroupName, Config) -> Config. +end_per_testcase(_Case, Config) when is_list(Config) -> + case whereis(busy_drv_server) of + undefined -> + ok; + Pid when is_pid(Pid) -> + Ref = monitor(process, Pid), + unlink(Pid), + exit(Pid, kill), + receive + {'DOWN',Ref,process,Pid,_} -> + ok + end + end, + Config. %% Tests I/O operations to a busy port, to make sure a suspended send %% operation is correctly restarted. This used to crash Beam. |