Skip to content

Tests for PR - Fix HPACK dynamic table desync#972

Open
const-t wants to merge 2 commits intomasterfrom
kt-fix-hpack-desync
Open

Tests for PR - Fix HPACK dynamic table desync#972
const-t wants to merge 2 commits intomasterfrom
kt-fix-hpack-desync

Conversation

@const-t
Copy link
Copy Markdown
Contributor

@const-t const-t commented Mar 11, 2026

No description provided.

@const-t const-t changed the title Tests for PR - Fix HAPCK dynamic table desync Tests for PR - Fix HPACK dynamic table desync Mar 11, 2026
@const-t const-t force-pushed the kt-fix-hpack-desync branch from 8680ec1 to 7412b2a Compare March 17, 2026 15:11
@const-t const-t marked this pull request as ready for review March 17, 2026 15:18
@const-t const-t requested a review from RomanBelozerov March 18, 2026 14:43
@const-t const-t force-pushed the kt-fix-hpack-desync branch from 7412b2a to f3c94d9 Compare March 18, 2026 14:49
# 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
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.

Please move this comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved

)
self.assertEqual(client.h2_connection.decoder.header_table_size, 4096)

def test_bytes_of_table_size_in_header_frame_of_trailers(self):
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 rebase and rework these tests with asyncio.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines +470 to +471
client.h2_connection.decoder.header_table_size = table_size
self.assertEqual(client.h2_connection.decoder.header_table_size, table_size)
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 check python side here, the test works without these lines. What do you want to check here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed

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
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.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed

Comment on lines +522 to +525
# 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)
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.

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.

Copy link
Copy Markdown
Contributor Author

@const-t const-t Mar 30, 2026

Choose a reason for hiding this comment

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

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.

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
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.

The line is not necessary. At the moment, the value of valid_req_num is 1.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed

@const-t const-t force-pushed the kt-fix-hpack-desync branch from f3c94d9 to 0219346 Compare March 30, 2026 12:48
@const-t const-t requested a review from RomanBelozerov March 30, 2026 12:50
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