aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2017-10-25 08:52:04 +0200
committerJohn Högberg <[email protected]>2017-10-25 08:52:04 +0200
commitc26f0e58f440859abbfb9b4e3570713ac722e0da (patch)
tree6bcbc29c8f4501c05a598262787ef06fb5a7666c /lib/kernel/test
parent541ee20b9eaefed7802f08cecddfbd12e5f3b516 (diff)
parenta98379d0519c28f9bc9b673ed2c09fb1ad52456e (diff)
downloadotp-c26f0e58f440859abbfb9b4e3570713ac722e0da.tar.gz
otp-c26f0e58f440859abbfb9b4e3570713ac722e0da.tar.bz2
otp-c26f0e58f440859abbfb9b4e3570713ac722e0da.zip
Merge branch 'maint-20' into maint
* maint-20: Updated OTP version Update release notes Update version numbers erts: Fix so that bind correct schedulers Update version Fix error handling when decoding an AVP with an alternate dictionary Remove unused function arguments Fix faulty recursion vsn -> 2.1.2 Update appup for ERIERL-14684 Fix speling error 'sndbuf' -> 'recbuf' Add zlib:set_controlling_process/2
Diffstat (limited to 'lib/kernel/test')
-rw-r--r--lib/kernel/test/zlib_SUITE.erl26
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/kernel/test/zlib_SUITE.erl b/lib/kernel/test/zlib_SUITE.erl
index d17eded811..1afcd155b3 100644
--- a/lib/kernel/test/zlib_SUITE.erl
+++ b/lib/kernel/test/zlib_SUITE.erl
@@ -978,23 +978,37 @@ split_bin(Last,Acc) ->
only_allow_owner(Config) when is_list(Config) ->
Z = zlib:open(),
+ Owner = self(),
?m(ok, zlib:inflateInit(Z)),
?m(ok, zlib:inflateReset(Z)),
{Pid, Ref} = spawn_monitor(
fun() ->
- ?m(?EXIT(not_on_controlling_process), zlib:inflateReset(Z))
+ ?m(?EXIT(not_on_controlling_process), zlib:inflateReset(Z)),
+ Owner ! '$transfer_ownership',
+ receive
+ '$ownership_transferred' ->
+ ?m(ok, zlib:inflateReset(Z))
+ after 200 ->
+ ct:fail("Never received transfer signal.")
+ end
end),
+ ownership_transfer_check(Z, Pid, Ref).
+ownership_transfer_check(Z, WorkerPid, Ref) ->
receive
- {'DOWN', Ref, process, Pid, _Reason} ->
- ok
+ '$transfer_ownership' ->
+ zlib:set_controlling_process(Z, WorkerPid),
+ WorkerPid ! '$ownership_transferred',
+ ownership_transfer_check(Z, WorkerPid, Ref);
+ {'DOWN', Ref, process, WorkerPid, normal} ->
+ ok;
+ {'DOWN', Ref, process, WorkerPid, Reason} ->
+ ct:fail("Spawned worker crashed with reason ~p.", [Reason])
after 200 ->
ct:fail("Spawned worker timed out.")
- end,
-
- ?m(ok, zlib:inflateReset(Z)).
+ end.
sub_heap_binaries(Config) when is_list(Config) ->
Compressed = zlib:compress(<<"gurka">>),