Tests for PR - Fix HPACK dynamic table desync#972
Conversation
8680ec1 to
7412b2a
Compare
7412b2a to
f3c94d9
Compare
tests/http2_general/test_h2_hpack.py
Outdated
| # and this default value for table size. | ||
| # Therefore Tempesta does not return bytes of table size in header frame. | ||
| client.update_initial_settings(header_table_size=12288) | ||
| # and we expect \x3f\xe1\x07 bytes in first header frame |
There was a problem hiding this comment.
Please move this comment.
tests/http2_general/test_h2_hpack.py
Outdated
| ) | ||
| self.assertEqual(client.h2_connection.decoder.header_table_size, 4096) | ||
|
|
||
| def test_bytes_of_table_size_in_header_frame_of_trailers(self): |
There was a problem hiding this comment.
You should rebase and rework these tests with asyncio.
tests/http2_general/test_h2_hpack.py
Outdated
| client.h2_connection.decoder.header_table_size = table_size | ||
| self.assertEqual(client.h2_connection.decoder.header_table_size, table_size) |
There was a problem hiding this comment.
You check python side here, the test works without these lines. What do you want to check here?
tests/http2_general/test_h2_hpack.py
Outdated
| client.send_bytes(client.h2_connection.data_to_send()) | ||
| client.wait_for_ack_settings() | ||
|
|
||
| client.last_response_buffer = bytes() # clearing the buffer after exchanging settings |
There was a problem hiding this comment.
Why it is necessary? The test works without the line. I think changing the buffer in the test is a bad idea. Probably we should to change it as a protected variable.
| # send the new table size | ||
| client.send_settings_frame(header_table_size=new_table_size) | ||
| # ensure that the current table size is equal to default 4096 | ||
| self.assertEqual(client.h2_connection.decoder.header_table_size, 4096) |
There was a problem hiding this comment.
Why do you change header_table_size here? Why do you send header_table_size=2048 but expected 4096? Sorry, it is difficult test and i think we need to more comments here. It is point 4 from docstring but I don't understand why do we need to change header_table_size here
And the assert self.assertEqual(client.h2_connection.decoder.header_table_size, 4096) checks python side here.
There was a problem hiding this comment.
I've added comment, we need this to be sure that size of dynamic table is 4096 at this moment, the same as for Tempesta.
tests/http2_general/test_h2_hpack.py
Outdated
| client.increment_flow_control_window(stream_id=1, flow_controlled_length=100) | ||
|
|
||
| # we are ready to receive body and trailers to that | ||
| client.valid_req_num = 1 # change the expected number of responses |
There was a problem hiding this comment.
The line is not necessary. At the moment, the value of valid_req_num is 1.
f3c94d9 to
0219346
Compare
No description provided.