Fixed sleep timing on IPC log rate limit unit tests #4624

Still a little hacky, but seems stable on my dev machine
This commit is contained in:
Nick Bolton 2015-05-19 10:41:04 +01:00
parent efa358f917
commit 2cce60f672
1 changed files with 3 additions and 2 deletions

View File

@ -77,7 +77,7 @@ TEST(IpcLogOutputterTests, write_bufferRateLimit)
EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 3\n"), _)).Times(1); EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 3\n"), _)).Times(1);
IpcLogOutputter outputter(mockServer); IpcLogOutputter outputter(mockServer);
outputter.bufferRateLimit(1, 0.01); // 5ms outputter.bufferRateLimit(1, 0.001); // 1ms
// log 1 more line than the buffer can accept in time limit. // log 1 more line than the buffer can accept in time limit.
outputter.write(kNOTE, "mock 1"); outputter.write(kNOTE, "mock 1");
@ -86,8 +86,9 @@ TEST(IpcLogOutputterTests, write_bufferRateLimit)
// after waiting the time limit send another to make sure // after waiting the time limit send another to make sure
// we can log after the time limit passes. // we can log after the time limit passes.
ARCH->sleep(0.001); // 10ms ARCH->sleep(0.01); // 10ms
outputter.write(kNOTE, "mock 3"); outputter.write(kNOTE, "mock 3");
outputter.write(kNOTE, "mock 4");
outputter.waitForEmpty(); outputter.waitForEmpty();
} }