diff options
author | Magnus Henoch <[email protected]> | 2016-04-27 17:21:24 +0100 |
---|---|---|
committer | Magnus Henoch <[email protected]> | 2016-04-27 17:21:24 +0100 |
commit | 79cf49a82bd1e654f05b3be092ee11686ac2828c (patch) | |
tree | a803acb99488abc46de1bb6a76c14868a1392e9d | |
parent | 2b1767d29f7bd9d5d611b28624d9dd8bdbc620ce (diff) | |
download | otp-79cf49a82bd1e654f05b3be092ee11686ac2828c.tar.gz otp-79cf49a82bd1e654f05b3be092ee11686ac2828c.tar.bz2 otp-79cf49a82bd1e654f05b3be092ee11686ac2828c.zip |
Avoid disappearing ETS tables in ssl_dist_SUITE
When recording the fact that a verify function ran, spawn a new
process to own the ETS table, to ensure that it's still there when we
want to query it.
-rw-r--r-- | lib/ssl/test/ssl_dist_SUITE.erl | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/ssl/test/ssl_dist_SUITE.erl b/lib/ssl/test/ssl_dist_SUITE.erl index fa36b424ce..6aacc8ecf4 100644 --- a/lib/ssl/test/ssl_dist_SUITE.erl +++ b/lib/ssl/test/ssl_dist_SUITE.erl @@ -452,8 +452,16 @@ verify_fun_fail(Config) when is_list(Config) -> verify_fail_always(_Certificate, _Event, _State) -> %% Create an ETS table, to record the fact that the verify function ran. - ets:new(verify_fun_ran, [public, named_table, {heir, whereis(ssl_tls_dist_proxy), {}}]), - ets:insert(verify_fun_ran, {verify_fail_always_ran, true}), + %% Spawn a new process, to avoid the ETS table disappearing. + Parent = self(), + spawn( + fun() -> + ets:new(verify_fun_ran, [public, named_table]), + ets:insert(verify_fun_ran, {verify_fail_always_ran, true}), + Parent ! go_ahead, + timer:sleep(infinity) + end), + receive go_ahead -> ok end, {fail, bad_certificate}. %%-------------------------------------------------------------------- @@ -490,8 +498,16 @@ verify_fun_pass(Config) when is_list(Config) -> verify_pass_always(_Certificate, _Event, State) -> %% Create an ETS table, to record the fact that the verify function ran. - ets:new(verify_fun_ran, [public, named_table, {heir, whereis(ssl_tls_dist_proxy), {}}]), - ets:insert(verify_fun_ran, {verify_pass_always_ran, true}), + %% Spawn a new process, to avoid the ETS table disappearing. + Parent = self(), + spawn( + fun() -> + ets:new(verify_fun_ran, [public, named_table]), + ets:insert(verify_fun_ran, {verify_pass_always_ran, true}), + Parent ! go_ahead, + timer:sleep(infinity) + end), + receive go_ahead -> ok end, {valid, State}. %%-------------------------------------------------------------------- crl_check_pass() -> |