aboutsummaryrefslogtreecommitdiffstats
path: root/test/http2_SUITE.erl
AgeCommit message (Collapse)Author
2024-01-25Refresh copyright linesLoïc Hoguin
2023-12-21Optionally reset the idle timeout when sending dataRobert J. Macomber
A new option reset_idle_timeout_on_send has been added. When set to 'true', the idle timeout is reset not only when data is received, but also when data is sent. This allows sending large responses without having to worry about timeouts triggering. The default is currently unchanged but might change in a future release. LH: Greatly reworked the implementation so that the timeout gets reset on almost all socket writes. This essentially completely supersets the original work. Tests are mostly the same although I refactored a bit to avoid test code duplication. This commit also changes HTTP/2 behavior a little when data is received: Cowboy will not attempt to update the window before running stream handler commands to avoid sending WINDOW_UPDATE frames twice. Now it has some small heuristic to ensure they can only be sent once at most.
2023-12-18Explicitly close the socket in some tests for speed upsLoïc Hoguin
The socket staying open meant that the graceful shut down of the Cowboy listeners were waiting for the connections to be closed gracefully (or a timeout). Closing explicitly where it makes sense ensures we don't unnecessarily wait. This commit removes a full minute in the run time of all Cowboy test suites (minus examples).
2023-12-14Change send_timeout_close test to accomodate macOSLoïc Hoguin
2023-12-12Add test for send_timeout_closeSergei Shuvatov
LH: I reworked the test a little and added the same test for HTTP/2 so that both HTTP/1.1 and HTTP/2 get the issue fixed.
2020-11-27Graceful shutdownViktor Söderqvist
Note: This commit makes cowboy depend on cowlib master. Graceful shutdown for HTTP/2: 1. A GOAWAY frame with the last stream id set to 2^31-1 is sent and a timer is started (goaway_initial_timeout, default 1000ms), to wait for any in-flight requests sent by the client, and the status is set to 'closing_initiated'. If the client responds with GOAWAY and closes the connection, we're done. 2. A second GOAWAY frame is sent with the actual last stream id and the status is set to 'closing'. If no streams exist, the connection terminates. Otherwise a second timer (goaway_complete_timeout, default 3000ms) is started, to wait for the streams to complete. New streams are not accepted when status is 'closing'. 3. If all streams haven't completed after the second timeout, the connection is forcefully terminated. Graceful shutdown for HTTP/1.x: 1. If a request is currently being handled, it is waited for and the response is sent back to the client with the header "Connection: close". Then, the connection is closed. 2. If the current request handler is not finished within the time configured in transport option 'shutdown' (default 5000ms), the connection process is killed by its supervisor (ranch). Implemented for HTTP/1.x and HTTP/2 in the following scenarios: * When receiving exit signal 'shutdown' from the supervisor (e.g. when cowboy:stop_listener/3 is called). * When a connection process is requested to terminate using sys:terminate/2,3. LH: Edited tests a bit and added todos for useful tests to add.
2019-09-28Add persistent_term support to the routerLoïc Hoguin
2018-11-21Move some tests out of the old HTTP test suiteLoïc Hoguin
And additional minor tweaks.
2018-11-19Use try..after in tests that start their own listenersLoïc Hoguin
2018-11-19Use ?FUNCTION_NAME instead of ct_helper:name()Loïc Hoguin
Cowboy is 19+ so it's OK to use it.
2018-11-16Add the idle_timeout option to HTTP/2Loïc Hoguin
2018-08-13Fix the infinity timeout testsLoïc Hoguin
Make sure the test fails when the code is incorrect.
2018-08-13Fix cancelling undefined settings timerBing Han
when settings_timeout is infinity
2018-05-20Fix intermittent failure of max_frame_size_sent testLoïc Hoguin
2018-04-27Add options controlling maximum h2 frame sizesLoïc Hoguin
2018-04-26Add options controlling initial control flow windowsLoïc Hoguin
2018-03-14Add case for handling infinity for idle/request_timeoutBartek Walkowicz
Currently cowboy assumes that idle_timeout or request_timeout is a number and always starts timers. Similar situation takes place in case of preface_timeout for http2. This commit adds case for handling infinity as a timeout, allowing to not start mentioned timers.
2018-01-23Fix a miscount of output flow control window for HTTP/2Loïc Hoguin
The miscount occurred because of a faulty iolist split function. The bug should now be corrected, a PropEr test has been added and a regression test has also been added.
2017-11-29Add nowarn_export_all to all test suitesLoïc Hoguin
2017-06-07Remove NumAcceptors argument from start_clear/tlsLoïc Hoguin
They are now cowboy:start_clear/3 and cowboy:start_tls/3. The NumAcceptors argument can be specified via the num_acceptor transport option. Ranch has been updated to 1.4.0 to that effect.
2017-05-05Add test for inactivity_timeout option in cowboy_http2Gary Rennie
The inactivity timeout is used to close the connection in the absence of any data from the client. Since this is not part or the rfc7540 spec, a new http2_SUITE module has been created with a test for the inactivity_timeout.