From: James Sedgwick Date: Fri, 26 Sep 2014 15:48:09 +0000 (-0700) Subject: fix more flakey tests X-Git-Tag: v0.22.0~321 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fa43917d8aad3fb20bcd5005c4b5cd524aeb149b;p=folly.git 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 --- diff --git a/folly/experimental/wangle/concurrent/test/ThreadPoolExecutorTest.cpp b/folly/experimental/wangle/concurrent/test/ThreadPoolExecutorTest.cpp index d36cca78..bacee2ba 100644 --- a/folly/experimental/wangle/concurrent/test/ThreadPoolExecutorTest.cpp +++ b/folly/experimental/wangle/concurrent/test/ThreadPoolExecutorTest.cpp @@ -61,10 +61,10 @@ TEST(ThreadPoolExecutorTest, IOResize) { template static void stop() { - TPE tpe(10); + TPE tpe(1); std::atomic completed(0); auto f = [&](){ - burnMs(1)(); + burnMs(10)(); completed++; }; for (int i = 0; i < 1000; i++) { @@ -203,7 +203,7 @@ static void expiration() { })); std::atomic expireCbCount(0); 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.join(); EXPECT_EQ(2, statCbCount);