aboutsummaryrefslogtreecommitdiffstats
path: root/test/shutdown_SUITE.erl
AgeCommit message (Collapse)Author
2020-03-28Use timetrap instead of normal timeouts in shutdown_SUITELoïc Hoguin
2020-03-23Tweak connection timeouts tests for WindowsLoïc Hoguin
It seems that the retry behavior changed recently. It would be better to retrieve the exact values and calculate how much time we want to wait but that will do for now.
2019-09-22Account for Windows' 3-connect pattern in shutdown_SUITELoïc Hoguin
When Windows can't connect it retries 2 more times with 500ms wait in-between by default.
2019-09-22Add Socks5->HTTP/2 testsLoïc Hoguin
Also consolidate the ALPN code in the tls_handshake state rather than doing it in CONNECT/Socks separately. Also improves the origin tests by sending a message once the handshake is completed instead of having timeouts.
2019-09-06Fix failing tests caused by DATA no longer being sentLoïc Hoguin
2019-09-05Implement graceful shutdownLoïc Hoguin
The graceful shutdown is implemented through a new 'closing' state. This state is entered under different circumstances depending on the protocol. The gun:shutdown/1 function is now implemented and documented. It allows shutting down the connection gracefully regardless of the current state of the connection and for all protocols. The behavior is entirely dependent on the protocol. For HTTP/1.1 the connection stays up only until after the current stream is complete; other streams are immediately canceled. For HTTP/2 a GOAWAY frame is sent and existing streams continue to be processed. The connection is closed after all streams are processed and the server's GOAWAY frame is received. For Websocket a close frame is sent. The connection is closed when receiving the server's close frame. In all cases the closing_timeout option defines how long we wait, as a maximum, before closing the connection after the graceful shutdown was started. The graceful shutdown is also initiated when the owner process goes away; when sending an HTTP/1.1 request with the connection: close header; when receiving an HTTP/1.1 response with the connection: close header; when receiving an HTTP/1.0 response without a connection header; when the server sends a GOAWAY HTTP/2 frame; or when we send or receive a Websocket close frame. Along with these changes, the gun:ws_send/2 function now accepts a list of frames as argument. Those frames may include a close frame that initiates the graceful shutdown.