Commit fa43917d authored by James Sedgwick's avatar James Sedgwick Committed by Anton Likhtarov

fix more flakey tests

Summary: fixed the one brought up in the task, and tweaked another that could theoretically cause problems

Test Plan: ran, though I have not been able to repro the

Reviewed By: njormrod@fb.com

Subscribers: fugalh, njormrod

FB internal diff: D1575632

Tasks: 5225808
parent 3f54bba7
...@@ -61,10 +61,10 @@ TEST(ThreadPoolExecutorTest, IOResize) { ...@@ -61,10 +61,10 @@ TEST(ThreadPoolExecutorTest, IOResize) {
template <class TPE> template <class TPE>
static void stop() { static void stop() {
TPE tpe(10); TPE tpe(1);
std::atomic<int> completed(0); std::atomic<int> completed(0);
auto f = [&](){ auto f = [&](){
burnMs(1)(); burnMs(10)();
completed++; completed++;
}; };
for (int i = 0; i < 1000; i++) { for (int i = 0; i < 1000; i++) {
...@@ -203,7 +203,7 @@ static void expiration() { ...@@ -203,7 +203,7 @@ static void expiration() {
})); }));
std::atomic<int> expireCbCount(0); std::atomic<int> expireCbCount(0);
auto expireCb = [&] () { expireCbCount++; }; auto expireCb = [&] () { expireCbCount++; };
tpe.add(burnMs(10), milliseconds(10), expireCb); tpe.add(burnMs(10), seconds(60), expireCb);
tpe.add(burnMs(10), milliseconds(10), expireCb); tpe.add(burnMs(10), milliseconds(10), expireCb);
tpe.join(); tpe.join();
EXPECT_EQ(2, statCbCount); EXPECT_EQ(2, statCbCount);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment