diff options
author | Rikard Green <uabgrei@sekic2078.(none)> | 2011-05-19 10:13:40 +0200 |
---|---|---|
committer | Rikard Green <uabgrei@sekic2078.(none)> | 2011-05-19 10:13:40 +0200 |
commit | bee8d1e7ea9f116a1889c314096d8612720c75cf (patch) | |
tree | 4d0ef4682534c63b3fdb742a72c5d64abc7e3145 /erts/emulator/test/driver_SUITE.erl | |
parent | e4eb882412643a702d008579c23d465516b5f228 (diff) | |
parent | 860e7deba85a770ae463ebd36287f1da42eea48b (diff) | |
download | otp-bee8d1e7ea9f116a1889c314096d8612720c75cf.tar.gz otp-bee8d1e7ea9f116a1889c314096d8612720c75cf.tar.bz2 otp-bee8d1e7ea9f116a1889c314096d8612720c75cf.zip |
Merge branch 'rickard/driver_async_cancel/OTP-9302' into dev
* rickard/driver_async_cancel/OTP-9302:
Fix driver_async_cancel()
Diffstat (limited to 'erts/emulator/test/driver_SUITE.erl')
-rw-r--r-- | erts/emulator/test/driver_SUITE.erl | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/erts/emulator/test/driver_SUITE.erl b/erts/emulator/test/driver_SUITE.erl index 520e3e8c76..f6cf01ce16 100644 --- a/erts/emulator/test/driver_SUITE.erl +++ b/erts/emulator/test/driver_SUITE.erl @@ -74,7 +74,8 @@ missing_callbacks/1, smp_select/1, driver_select_use/1, - thread_mseg_alloc_cache_clean/1]). + thread_mseg_alloc_cache_clean/1, + otp_9302/1]). -export([bin_prefix/2]). @@ -141,7 +142,8 @@ all() -> smaller_minor_vsn_drv, peek_non_existing_queue, otp_6879, caller, many_events, missing_callbacks, smp_select, driver_select_use, - thread_mseg_alloc_cache_clean]. + thread_mseg_alloc_cache_clean, + otp_9302]. groups() -> [{timer, [], @@ -1890,13 +1892,39 @@ thread_mseg_alloc_cache_clean_test(Port, N, CCI, Size) -> ?line ?t:format("CCC = ~p~n", [CCC]), ?line true = CCC > OCCC, ?line thread_mseg_alloc_cache_clean_test(Port, N-1, CCI, Size). - - + +otp_9302(Config) when is_list(Config) -> + ?line Path = ?config(data_dir, Config), + ?line erl_ddll:start(), + ?line ok = load_driver(Path, otp_9302_drv), + ?line Port = open_port({spawn, otp_9302_drv}, []), + ?line true = is_port(Port), + ?line port_command(Port, ""), + ?line {msg, block} = get_port_msg(Port, infinity), + ?line {msg, job} = get_port_msg(Port, infinity), + ?line case erlang:system_info(thread_pool_size) of + 0 -> + {msg, cancel} = get_port_msg(Port, infinity); + _ -> + ok + end, + ?line {msg, job} = get_port_msg(Port, infinity), + ?line {msg, end_of_jobs} = get_port_msg(Port, infinity), + ?line no_msg = get_port_msg(Port, 2000), + ?line port_close(Port), + ?line ok. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Utilities %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - + +get_port_msg(Port, Timeout) -> + receive + {Port, What} -> + {msg, What} + after Timeout -> + no_msg + end. wait_until(Fun) -> case Fun() of |