Fixed compile issue for backporting by removing 'AwaitSingleAbandon'.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/90184094 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/90184094 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/90184094 Branch: refs/heads/1.4.x Commit: 90184094a61254b811246ef877203a91f0895942 Parents: 15c194b Author: Gilbert Song <songzihao1...@gmail.com> Authored: Mon Mar 5 18:09:40 2018 -0800 Committer: Gilbert Song <songzihao1...@gmail.com> Committed: Mon Mar 5 18:11:12 2018 -0800 ---------------------------------------------------------------------- 3rdparty/libprocess/src/tests/collect_tests.cpp | 35 -------------------- 1 file changed, 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/90184094/3rdparty/libprocess/src/tests/collect_tests.cpp ---------------------------------------------------------------------- diff --git a/3rdparty/libprocess/src/tests/collect_tests.cpp b/3rdparty/libprocess/src/tests/collect_tests.cpp index 0dd3771..cd6f259 100644 --- a/3rdparty/libprocess/src/tests/collect_tests.cpp +++ b/3rdparty/libprocess/src/tests/collect_tests.cpp @@ -274,38 +274,3 @@ TEST(AwaitTest, AwaitSingleDiscard) EXPECT_TRUE(promise.future().hasDiscard()); } - - -TEST(AwaitTest, AwaitSingleAbandon) -{ - Owned<Promise<int>> promise(new Promise<int>()); - - auto bar = [&]() { - return promise->future(); - }; - - auto foo = [&]() { - return await(bar()) - .then([](const Future<int>& f) { - return f - .then([](int i) { - return stringify(i); - }); - }); - }; - - // There is a race from the time that we reset the promise to when - // the await process is terminated so we need to use Future::recover - // to properly handle this case. - Future<string> future = foo() - .recover([](const Future<string>& f) -> Future<string> { - if (f.isAbandoned()) { - return "hello"; - } - return f; - }); - - promise.reset(); - - AWAIT_EQ("hello", future); -}