Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
1422-inets-Fix-httpc-parallel-tests-failing-on-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1422-inets-Fix-httpc-parallel-tests-failing-on-FreeBSD.patch of Package erlang
From 777c150f789cb720173468718635ef50927938d0 Mon Sep 17 00:00:00 2001 From: Johannes Christ <jc@jchri.st> Date: Fri, 8 Dec 2023 17:45:14 +0100 Subject: [PATCH] inets: Fix httpc parallel tests failing on FreeBSD With the parallel tests recently introduced into httpc_SUITE, multiple clients may be waiting to be accepted (`gen_tcp:accept`) by the test server spawned in `http_test_lib` at once. On Linux, if the backlog is full, clients wait for a while before timing out. On FreeBSD however, the connection is instantly rejected with `ECONNRESET`, causing most tests in the parallel groups to fail simultaneously. Increase the backlog from the default 5 to 100 to queue up excess requests on FreeBSD the same way as on Linux. --- lib/inets/test/http_test_lib.erl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/inets/test/http_test_lib.erl b/lib/inets/test/http_test_lib.erl index 5f58dbbe8b..38dd2a2027 100644 --- a/lib/inets/test/http_test_lib.erl +++ b/lib/inets/test/http_test_lib.erl @@ -28,6 +28,7 @@ %% Note: This directive should only be used in test suites. -compile(export_all). +-define(SOCKET_BACKLOG, 100). dummy_server(SocketType, Inet, Extra) -> dummy_server(self(), SocketType, Inet, Extra). @@ -42,7 +43,8 @@ dummy_server(Caller, SocketType, Inet, Extra) -> dummy_server_init(Caller, ip_comm, Inet, Extra) -> ContentCb = proplists:get_value(content_cb, Extra), - BaseOpts = [binary, {packet, 0}, {reuseaddr,true}, {active, false}, {nodelay, true}], + BaseOpts = [binary, {packet, 0}, {reuseaddr,true}, + {active, false}, {nodelay, true}, {backlog, ?SOCKET_BACKLOG}], Conf = proplists:get_value(conf, Extra), {ok, ListenSocket} = gen_tcp:listen(0, [Inet | BaseOpts]), {ok, Port} = inet:port(ListenSocket), @@ -60,8 +62,8 @@ dummy_server_init(Caller, unix_socket, Inet, Extra) -> ContentCb = proplists:get_value(content_cb, Extra), UnixSocket = proplists:get_value(unix_socket, Extra), SocketAddr = {local, UnixSocket}, - BaseOpts = [binary, {packet, 0}, {reuseaddr,true}, {active, false}, {nodelay, true}, - {ifaddr, SocketAddr}], + BaseOpts = [binary, {packet, 0}, {reuseaddr,true}, {active, false}, + {nodelay, true}, {ifaddr, SocketAddr}, {backlog, ?SOCKET_BACKLOG}], Conf = proplists:get_value(conf, Extra), {ok, ListenSocket} = gen_tcp:listen(0, [Inet | BaseOpts]), {ok, Port} = inet:port(ListenSocket), @@ -79,7 +81,8 @@ dummy_server_init(Caller, ssl, Inet, Extra) -> ContentCb = proplists:get_value(content_cb, Extra), SSLOptions = proplists:get_value(ssl, Extra), Conf = proplists:get_value(conf, Extra), - BaseOpts = [binary, {active, false}, {nodelay, true} | SSLOptions], + BaseOpts = [binary, {active, false}, {nodelay, true}, + {backlog, ?SOCKET_BACKLOG} | SSLOptions], dummy_ssl_server_init(Caller, BaseOpts, Inet, ContentCb, Conf). dummy_ssl_server_init(Caller, BaseOpts, Inet, ContentCb, Conf) -> -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor