This is an archive of the discontinued Mercurial Phabricator instance.

util: don't log low-level I/O calls for HTTP peer
ClosedPublic

Authored by indygreg on Mar 13 2018, 3:11 PM.

Details

Summary

hg debugwireproto is useful for testing HTTP interactions. Possibly
more useful than get-with-headers.py. But one thing that makes it
annoying for mid-level tests is that it logs all API calls, such
as readline(). This makes output - especially headers - overly
verbose.

This commit teaches our file and socket observers to not log API
calls on functions dealing with data.

We change the behavior of hg debugwireproto to enable this mode
by default. --debug can be added to restore the previous behavior.

As the test changes demonstrate, this makes tests much easier to
read. As a bonus, it also removes some required (glob) over lengths
in system call results.

One thing that's lacking is knowing which side sent data. But we can
fix this in a follow-up once it becomes a problem.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Mar 13 2018, 3:11 PM
indygreg updated this revision to Diff 7008.Mar 13 2018, 9:16 PM
durin42 accepted this revision.Mar 19 2018, 9:37 PM
durin42 added a subscriber: durin42.

This one needs rebased, but looks good.

This revision is now accepted and ready to land.Mar 19 2018, 9:37 PM
indygreg updated this revision to Diff 7161.Mar 20 2018, 12:09 PM
durin42 accepted this revision.Mar 21 2018, 3:17 PM
indygreg updated this revision to Diff 7192.Mar 21 2018, 6:19 PM
durin42 accepted this revision.Mar 21 2018, 6:21 PM
This revision was automatically updated to reflect the committed changes.