From bb400ba01a116628a230cabbc1c472d0c7c06905 Mon Sep 17 00:00:00 2001 From: Hans Fugal Date: Thu, 11 Jun 2015 13:35:49 -0700 Subject: [PATCH 1/1] disable ThreadExecutor in FutureTest.cpp, on OSX Summary: Something's broken here, will track fixing in #7372389 Reviewed By: @jsedgwick Differential Revision: D2144077 --- folly/futures/test/ViaTest.cpp | 56 ++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/folly/futures/test/ViaTest.cpp b/folly/futures/test/ViaTest.cpp index 499d61d4..6ed8e29c 100644 --- a/folly/futures/test/ViaTest.cpp +++ b/folly/futures/test/ViaTest.cpp @@ -291,6 +291,7 @@ TEST(Via, then2Variadic) { EXPECT_TRUE(f.a); } +#ifndef __APPLE__ // TODO #7372389 /// Simple executor that does work in another thread class ThreadExecutor : public Executor { folly::MPMCQueue funcs; @@ -339,6 +340,34 @@ TEST(Via, viaThenGetWasRacy) { EXPECT_EQ(42, *val); } +TEST(Via, callbackRace) { + ThreadExecutor x; + + auto fn = [&x]{ + auto promises = std::make_shared>>(4); + std::vector> futures; + + for (auto& p : *promises) { + futures.emplace_back( + p.getFuture() + .via(&x) + .then([](Try&&){})); + } + + x.waitForStartup(); + x.add([promises]{ + for (auto& p : *promises) { + p.setValue(); + } + }); + + return collectAll(futures); + }; + + fn().wait(); +} +#endif + class DummyDrivableExecutor : public DrivableExecutor { public: void add(Func f) override {} @@ -415,33 +444,6 @@ TEST(Via, viaRaces) { t2.join(); } -TEST(Via, callbackRace) { - ThreadExecutor x; - - auto fn = [&x]{ - auto promises = std::make_shared>>(4); - std::vector> futures; - - for (auto& p : *promises) { - futures.emplace_back( - p.getFuture() - .via(&x) - .then([](Try&&){})); - } - - x.waitForStartup(); - x.add([promises]{ - for (auto& p : *promises) { - p.setValue(); - } - }); - - return collectAll(futures); - }; - - fn().wait(); -} - TEST(ViaFunc, liftsVoid) { ManualExecutor x; int count = 0; -- 2.34.1