Skip to content

Commit

Permalink
rename __fill_tcp_buffer_and_disable_readable
Browse files Browse the repository at this point in the history
  • Loading branch information
kingluo committed May 27, 2024
1 parent bc02233 commit a7c2473
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions http2_general/test_max_queued_control_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ def __update_tempesta_config(self, limit: int) -> None:
self.get_tempesta().config.defconfig = self.get_tempesta().config.defconfig % limit

@staticmethod
def __fill_tcp_buffer_and_disable_readable(client) -> None:
"""
The client requests a lot of data, but it does not read them.
TCP buffer MUST be filled and TempestaFW cannot send other data.
"""
def __init_connection_and_disable_readable(client) -> None:
client.make_request(client.create_request(method="GET", headers=[]))
client.readable = lambda: False # disable socket for reading

Expand Down Expand Up @@ -96,7 +92,7 @@ def test(self, name, frame):
self.__update_tempesta_config(10)
self.start_all_services()
client = self.get_client("deproxy")
self.__fill_tcp_buffer_and_disable_readable(client)
self.__init_connection_and_disable_readable(client)

# the client should send more frames for stability of test
for _ in range(20): # max_queued_control_frames is 10.
Expand Down Expand Up @@ -126,7 +122,7 @@ def test_reset_stream(self, name, limit: int):
self.__update_tempesta_config(limit)
self.start_all_services()
client = self.get_client("deproxy")
self.__fill_tcp_buffer_and_disable_readable(client)
self.__init_connection_and_disable_readable(client)

headers = [
(":method", "GET"),
Expand Down

0 comments on commit a7c2473

Please sign in to comment.