Skip to content

Resolve issue with plaintext upgrade on the server side - #452

Merged
Lukasa merged 5 commits into
masterfrom
issue-451
Jan 27, 2017
Merged

Resolve issue with plaintext upgrade on the server side#452
Lukasa merged 5 commits into
masterfrom
issue-451

Conversation

@Lukasa

@Lukasa Lukasa commented Jan 27, 2017

Copy link
Copy Markdown
Member

Resolves #451.

@alexwlchan alexwlchan left a comment

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.

One question about the test, but the changelog/code look fine.

Comment thread test/test_h2_upgrade.py
# agree that these settings have been ACK'd, so their underlying
# dictionaries should be identical.
assert (
client.local_settings._settings == server.remote_settings._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.

This tells us that after we’ve exchanged some frames, the server/client settings match – but do we know they weren’t the same to start with? Should there be a second assert at the start of the test:

assert (
    client.local_settings._settings != server.remote_settings._settings
)

so we know sending the settings to the server really did have an effect on its settings?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, good call.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done. =D

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.

I’m slightly annoyed that if the new precondition fails, we’ll get a failure (bug in product code) rather than an error (bug in test setup).

But AFAIK, the only way pytest can throw an error is inside a fixture, and it’s not worth breaking this into a separate fixture for what’s a pretty trivial distinction.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think there is an alternative, which is to define __eq__ for the settings class. There is probably some value in that, but I shied away from it because I was concerned about adding all those extra tests in this PR.

@alexwlchan alexwlchan left a comment

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.

That issue resolved, LGTM. 👍

Comment thread test/test_h2_upgrade.py
# agree that these settings have been ACK'd, so their underlying
# dictionaries should be identical.
assert (
client.local_settings._settings == server.remote_settings._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.

I’m slightly annoyed that if the new precondition fails, we’ll get a failure (bug in product code) rather than an error (bug in test setup).

But AFAIK, the only way pytest can throw an error is inside a fixture, and it’s not worth breaking this into a separate fixture for what’s a pretty trivial distinction.

@Lukasa
Lukasa merged commit b215a11 into master Jan 27, 2017
@Lukasa
Lukasa deleted the issue-451 branch January 27, 2017 12:46
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