logging: improve the AsyncFileWriterTest discard test
authorAdam Simpkins <simpkins@fb.com>
Wed, 21 Jun 2017 02:44:16 +0000 (19:44 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 21 Jun 2017 02:50:53 +0000 (19:50 -0700)
commit440cddaf6c27d839d90cbc585c3c70023774b02c
tree327caf8e3fc165eb46d4553eaa06f05daa8871a7
parent61fbd6698139d3f797401da6350371c7afc4030c
logging: improve the AsyncFileWriterTest discard test

Summary:
This improves the test that exercises the AsyncFileWriter message discarding
logic.

Previously each writer thread wrote a fixed number of small messages.  This was
fairly slow, and wasn't always guaranteed to reliably produce discards.
Now each writer thread writes larger messages, which produce discards faster.
The test also automatically stops after 10 separate discard events, so that it
finishes faster (typically a few hundred milliseconds, rather than 5+ seconds).

This also updates the test to use XLOG() internally rather than using fprintf()
to print to stderr, now that the XLOG() diffs have landed.

Reviewed By: wez

Differential Revision: D5261059

fbshipit-source-id: 120224706fee36948ef76efbeb579ccc56400c51
folly/experimental/logging/test/AsyncFileWriterTest.cpp