Skip to content

Commit

Permalink
Disable tests that use tracing when +native is used
Browse files Browse the repository at this point in the history
  • Loading branch information
essen committed Nov 16, 2017
1 parent c9f004c commit 48631ae
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ebin/ranch.app
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{application, ranch, [
{application, 'ranch', [
{description, "Socket acceptor pool for TCP protocols."},
{vsn, "1.4.0"},
{modules, ['ranch','ranch_acceptor','ranch_acceptors_sup','ranch_app','ranch_conns_sup','ranch_listener_sup','ranch_protocol','ranch_server','ranch_ssl','ranch_sup','ranch_tcp','ranch_transport']},
Expand Down
40 changes: 35 additions & 5 deletions test/acceptor_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,13 @@ tcp_set_max_connections(_) ->
20 = ranch:get_max_connections(Name),
ok = ranch:stop_listener(Name).

tcp_set_max_connections_clean(_) ->
tcp_set_max_connections_clean(Config) ->
case code:is_module_native(?MODULE) of
true -> doc("This test uses tracing and is not compatible with native code.");
false -> do_tcp_set_max_connections_clean(Config)
end.

do_tcp_set_max_connections_clean(_) ->
doc("Ensure that setting max_connections does not crash any process."),
Name = name(),
{ok, ListSupPid} = ranch:start_listener(Name, ranch_tcp,
Expand Down Expand Up @@ -532,7 +538,13 @@ connection_type_supervisor_separate_from_connection(_) ->
{'EXIT', _} = begin catch ranch:get_port(Name) end,
ok.

supervisor_clean_child_restart(_) ->
supervisor_clean_child_restart(Config) ->
case code:is_module_native(?MODULE) of
true -> doc("This test uses tracing and is not compatible with native code.");
false -> do_supervisor_clean_child_restart(Config)
end.

do_supervisor_clean_child_restart(_) ->
doc("Verify that only the relevant parts of the supervision tree restarted "
"when the listening socket is closed."),
Name = name(),
Expand Down Expand Up @@ -591,7 +603,13 @@ supervisor_clean_conns_sup_restart(_) ->
end,
ok = ranch:stop_listener(Name).

supervisor_clean_restart(_) ->
supervisor_clean_restart(Config) ->
case code:is_module_native(?MODULE) of
true -> doc("This test uses tracing and is not compatible with native code.");
false -> do_supervisor_clean_restart(Config)
end.

do_supervisor_clean_restart(_) ->
doc("Verify that killing ranch_conns_sup does not crash everything "
"and that it restarts properly."),
Name = name(),
Expand Down Expand Up @@ -624,7 +642,13 @@ supervisor_clean_restart(_) ->
ok = clean_traces(),
ok = ranch:stop_listener(Name).

supervisor_conns_alive(_) ->
supervisor_conns_alive(Config) ->
case code:is_module_native(?MODULE) of
true -> doc("This test uses tracing and is not compatible with native code.");
false -> do_supervisor_conns_alive(Config)
end.

do_supervisor_conns_alive(_) ->
doc("Ensure that active connections stay open when the listening socket gets closed."),
Name = name(),
_ = erlang:trace(new, true, [call]),
Expand Down Expand Up @@ -665,7 +689,13 @@ supervisor_protocol_start_link_crash(_) ->
ConnsSup = ranch_server:get_connections_sup(Name),
ok = ranch:stop_listener(Name).

supervisor_server_recover_state(_) ->
supervisor_server_recover_state(Config) ->
case code:is_module_native(?MODULE) of
true -> doc("This test uses tracing and is not compatible with native code.");
false -> do_supervisor_server_recover_state(Config)
end.

do_supervisor_server_recover_state(_) ->
doc("Ensure that when ranch_server crashes and restarts, it recovers "
"its state and continues monitoring the same processes."),
Name = name(),
Expand Down
6 changes: 6 additions & 0 deletions test/sendfile_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ rawfile_range_small(Config) ->
ok = Transport:close(Server).

ssl_chunk_size(Config) ->
case code:is_module_native(?MODULE) of
true -> doc("This test uses tracing and is not compatible with native code.");
false -> do_ssl_chunk_size(Config)
end.

do_ssl_chunk_size(Config) ->
doc("Use sendfile with SSL. Ensure the sendfile fallback respects the chunk size."),
Transport = config(transport, Config),
Filename = config(filename, Config),
Expand Down

0 comments on commit 48631ae

Please sign in to comment.