test: Test verifies frang counter for clients with pending responses#985
Open
const-t wants to merge 1 commit into
Open
test: Test verifies frang counter for clients with pending responses#985const-t wants to merge 1 commit into
const-t wants to merge 1 commit into
Conversation
This test verifies that frang counter of active connections for client is not decrements while client has pending responses from upstream even when client already disconnected
RomanBelozerov
requested changes
Apr 15, 2026
| client.start() | ||
|
|
||
| for client in clients: | ||
| await client.wait_for_connection_open(timeout=2) |
Contributor
There was a problem hiding this comment.
You should check that the connection was opened.
Suggested change
| await client.wait_for_connection_open(timeout=2) | |
| await client.wait_for_connection_open(timeout=2, strict=True) |
| await client.wait_for_connection_open(timeout=2) | ||
|
|
||
| for client in clients: | ||
| client.make_request("GET / HTTP/1.1\r\nHost: localhost\r\n\r\n") |
Contributor
There was a problem hiding this comment.
Let's use create_request method into deproxy clients to create valid requests. It necessary to scale tests with h2\https
Suggested change
| client.make_request("GET / HTTP/1.1\r\nHost: localhost\r\n\r\n") | |
| client.make_request(client.create_request(method="GET", uri="/", headers=[])) |
| # Disconnect first clients | ||
| for client in clients: | ||
| client.stop() | ||
| await client.wait_for_connection_close(timeout=2) |
Contributor
There was a problem hiding this comment.
Suggested change
| await client.wait_for_connection_close(timeout=2) | |
| await client.wait_for_connection_close(timeout=2, strict=True) |
| client.make_request("GET / HTTP/1.1\r\nHost: localhost\r\n\r\n") | ||
|
|
||
| server = self.get_server("deproxy") | ||
| await server.wait_for_requests(n=2, timeout=2) |
Contributor
There was a problem hiding this comment.
You should use an empty response in this test, otherwise the clients may get responses before the test calls stop
| # This client expected to be dropped by Tempesta with limits violation | ||
| client_to_block = self.get_client("deproxy-2") | ||
| client_to_block.start() | ||
| await client.wait_for_connection_close(timeout=2) |
Contributor
There was a problem hiding this comment.
Suggested change
| await client.wait_for_connection_close(timeout=2) | |
| await client.wait_for_connection_close(timeout=2, strict=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This test verifies that frang counter of active connections for client is not decrements while client has pending responses from upstream even when client already disconnected