diff options
author | Loïc Hoguin <[email protected]> | 2020-04-02 16:23:36 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-04-02 16:23:36 +0200 |
commit | 3f37985d2c6b399796f53b8057beb9680514a25f (patch) | |
tree | d2161ba19a1be54b54f42c0d472d065005cd9066 /test | |
parent | 962d715ad496f0f46a8fa168fde0b9f030ab1192 (diff) | |
download | cowboy-3f37985d2c6b399796f53b8057beb9680514a25f.tar.gz cowboy-3f37985d2c6b399796f53b8057beb9680514a25f.tar.bz2 cowboy-3f37985d2c6b399796f53b8057beb9680514a25f.zip |
Skip ws_SUITE:unlimited_connections when ulimit -n is too low
Diffstat (limited to 'test')
-rw-r--r-- | test/ws_SUITE.erl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ws_SUITE.erl b/test/ws_SUITE.erl index 37f4012..0e940d6 100644 --- a/test/ws_SUITE.erl +++ b/test/ws_SUITE.erl @@ -77,6 +77,14 @@ init_dispatch() -> unlimited_connections(Config) -> doc("Websocket connections are not limited. The connections " "are removed from the count after the handshake completes."), + case list_to_integer(os:cmd("printf `ulimit -n`")) of + Limit when Limit > 6100 -> + do_unlimited_connections(Config); + _ -> + {skip, "`ulimit -n` reports a limit too low for this test."} + end. + +do_unlimited_connections(Config) -> _ = [begin spawn_link(fun() -> do_connect_and_loop(Config) end), timer:sleep(1) |