Try to fix IdleTime unit test
authorHaijun Zhu <haijunz@fb.com>
Tue, 20 Jan 2015 18:54:59 +0000 (10:54 -0800)
committerwoo <woo@fb.com>
Mon, 2 Feb 2015 21:11:48 +0000 (13:11 -0800)
commite26db8a2221698b9ba7319db9f54bd3a1eef74bb
tree35ea15dc0704dce711702d2d6f0ade6c51fe6dc1
parent5279c26d3a77ecd93d7bc62aa19313b5f72ba7de
Try to fix IdleTime unit test

Summary:
IdleTime unit test has been failing randomly (#5996886). The
event base loop calculates an exponentially moving average of loop busy
time in each loop. In the test, the busy time is initialized to 5900 and
each loop runs more than 8000 us. In normal case decaying of the
previous loop busy time will take 6 loops to  move this average to >6000.
But if the test is running on a heavily loaded machine the busy+idle time
a loop is longer than it should be, causing the decaying happen faster.
This diff skips this test if this happens.

Test Plan:
It won't affect anything if running on my devserver. It only
helps on a heavily loaded contbuild host.

Reviewed By: alandau@fb.com

Subscribers: folly-diffs@

FB internal diff: D1788450

Tasks: 5996886

Signature: t1:1788450:1421460774:1ec575c50f881e10b5a0208717fe68164f0d0f57
folly/io/async/EventBase.cpp
folly/io/async/test/EventBaseTest.cpp