Skip to content

Conversation

@wchargin
Copy link
Contributor

@wchargin wchargin commented Apr 14, 2020

Summary:
Fixes an oversight in #3507: we can’t assert that the raw bytes are what
was expected because the code under test does a proto serialization
roundtrip, which is permitted to permute keys.

Test Plan:
Tests still pass; a test sync shows that internal tests pass now, too.

wchargin-branch: uploader-test-proto-equal

Summary:
Fixes an oversight in #3507: we can’t assert that the raw bytes are what
was expected because the code under test does a proto serialization
roundtrip, which is permitted to permute keys.

Test Plan:
Tests still pass, and this should fix an internal sync error.

wchargin-branch: uploader-test-proto-equal
@wchargin
Copy link
Contributor Author

Tests still pass, and this should fix an internal sync error.

Confirmed: http://cl/306474605 (passes on 100/100 runs)

@wchargin wchargin requested a review from davidsoergel April 14, 2020 18:25
Copy link
Contributor

@nfelt nfelt left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

data = b"".join(r.data for r in requests)
self.assertEqual(data, graph_event.graph_def)
actual_graph_def = graph_pb2.GraphDef.FromString(data)
self.assertEqual(actual_graph_def, expected_graph_def)
Copy link
Contributor

Choose a reason for hiding this comment

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

might as well use assertProtoEquals() for the nicer diff?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure; done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can never remember the assertProtoEquals argument order; thankfully,
a web search turns up familiar faces…

Screenshot of DuckDuckGo search for assertprotoequals: the top result is a TensorBoard commit!

wchargin-branch: uploader-test-proto-equal
wchargin-source: 04ec53b1e69857650afdf5437e5e035f8d671623
@wchargin wchargin merged commit 0f36c3f into master Apr 14, 2020
@wchargin wchargin deleted the wchargin-uploader-test-proto-equal branch April 14, 2020 19:01
bileschi pushed a commit to bileschi/tensorboard that referenced this pull request Apr 15, 2020
Summary:
Fixes an oversight in tensorflow#3507: we can’t assert that the raw bytes are what
was expected because the code under test does a proto serialization
roundtrip, which is permitted to permute keys.

Test Plan:
Tests still pass; a test sync shows that internal tests pass now, too.

wchargin-branch: uploader-test-proto-equal
bileschi pushed a commit that referenced this pull request Apr 15, 2020
Summary:
Fixes an oversight in #3507: we can’t assert that the raw bytes are what
was expected because the code under test does a proto serialization
roundtrip, which is permitted to permute keys.

Test Plan:
Tests still pass; a test sync shows that internal tests pass now, too.

wchargin-branch: uploader-test-proto-equal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants