Skip to content

test: Test verifies frang counter for clients with pending responses#985

Open
const-t wants to merge 1 commit into
masterfrom
kt-max-concurrent-conn
Open

test: Test verifies frang counter for clients with pending responses#985
const-t wants to merge 1 commit into
masterfrom
kt-max-concurrent-conn

Conversation

@const-t
Copy link
Copy Markdown
Contributor

@const-t const-t commented Apr 9, 2026

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

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
@const-t const-t requested a review from RomanBelozerov April 9, 2026 09:55
client.start()

for client in clients:
await client.wait_for_connection_open(timeout=2)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await client.wait_for_connection_close(timeout=2)
await client.wait_for_connection_close(timeout=2, strict=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants