mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1471653 - /incubator/mesos/trunk/src/tests/
Date Wed, 24 Apr 2013 20:37:20 GMT
Author: benh
Date: Wed Apr 24 20:37:20 2013
New Revision: 1471653

URL: http://svn.apache.org/r1471653
Log:
Replaced libprocess specific testing abstractions.

Review: https://reviews.apache.org/r/10461

Modified:
    incubator/mesos/trunk/src/tests/allocator_tests.cpp
    incubator/mesos/trunk/src/tests/cgroups_tests.cpp
    incubator/mesos/trunk/src/tests/exception_tests.cpp
    incubator/mesos/trunk/src/tests/files_tests.cpp
    incubator/mesos/trunk/src/tests/gc_tests.cpp
    incubator/mesos/trunk/src/tests/logging_tests.cpp
    incubator/mesos/trunk/src/tests/master_detector_tests.cpp
    incubator/mesos/trunk/src/tests/master_tests.cpp
    incubator/mesos/trunk/src/tests/monitor_tests.cpp
    incubator/mesos/trunk/src/tests/resource_offers_tests.cpp
    incubator/mesos/trunk/src/tests/slave_recovery_tests.cpp
    incubator/mesos/trunk/src/tests/state_tests.cpp
    incubator/mesos/trunk/src/tests/utils.hpp
    incubator/mesos/trunk/src/tests/zookeeper_tests.cpp

Modified: incubator/mesos/trunk/src/tests/allocator_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/allocator_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/allocator_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/allocator_tests.cpp Wed Apr 24 20:37:20 2013
@@ -374,11 +374,7 @@ TYPED_TEST(AllocatorTest, ResourcesUnuse
     .WillOnce(LaunchTasks(1, 1, 512))
     .WillRepeatedly(DeclineOffers());
 
-  // We don't wait for the task to be launched, since we only care
-  // that the offer is accepted, so we don't wait for the executor
-  // to recieve messages, but it may get them anyways.
-  EXPECT_CALL(exec, registered(_, _, _, _))
-    .Times(AtMost(1));
+  EXPECT_CALL(exec, registered(_, _, _, _));
 
   Future<Nothing> launchTask;
   EXPECT_CALL(exec, launchTask(_, _))

Modified: incubator/mesos/trunk/src/tests/cgroups_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/cgroups_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/cgroups_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/cgroups_tests.cpp Wed Apr 24 20:37:20 2013
@@ -58,12 +58,12 @@ public:
   {
     // Clean up the testing hierarchy, in case it wasn't cleaned up
     // properly from previous tests.
-    ASSERT_FUTURE_WILL_SUCCEED(cgroups::cleanup(TEST_CGROUPS_HIERARCHY));
+    AWAIT_READY(cgroups::cleanup(TEST_CGROUPS_HIERARCHY));
   }
 
   static void TearDownTestCase()
   {
-    ASSERT_FUTURE_WILL_SUCCEED(cgroups::cleanup(TEST_CGROUPS_HIERARCHY));
+    AWAIT_READY(cgroups::cleanup(TEST_CGROUPS_HIERARCHY));
   }
 };
 
@@ -135,7 +135,7 @@ protected:
     Try<bool> exists = cgroups::exists(hierarchy, TEST_CGROUPS_ROOT);
     ASSERT_SOME(exists);
     if (exists.get()) {
-     ASSERT_FUTURE_WILL_SUCCEED(cgroups::destroy(hierarchy, TEST_CGROUPS_ROOT));
+     AWAIT_READY(cgroups::destroy(hierarchy, TEST_CGROUPS_ROOT));
     }
     ASSERT_SOME(cgroups::create(hierarchy, TEST_CGROUPS_ROOT));
   }
@@ -146,12 +146,12 @@ protected:
     Try<bool> exists = cgroups::exists(hierarchy, TEST_CGROUPS_ROOT);
     ASSERT_SOME(exists);
     if (exists.get()) {
-     ASSERT_FUTURE_WILL_SUCCEED(cgroups::destroy(hierarchy, TEST_CGROUPS_ROOT));
+     AWAIT_READY(cgroups::destroy(hierarchy, TEST_CGROUPS_ROOT));
     }
 
     // And cleanup TEST_CGROUPS_HIERARCHY in the event it is needed
     // to be created.
-    ASSERT_FUTURE_WILL_SUCCEED(cgroups::cleanup(TEST_CGROUPS_HIERARCHY));
+    AWAIT_READY(cgroups::cleanup(TEST_CGROUPS_HIERARCHY));
   }
 
   const std::string subsystems; // Subsystems required to run tests.

Modified: incubator/mesos/trunk/src/tests/exception_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/exception_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/exception_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/exception_tests.cpp Wed Apr 24 20:37:20 2013
@@ -82,14 +82,14 @@ TEST(ExceptionTest, DeactivateFrameworkO
 
   driver.start();
 
-  AWAIT_UNTIL(registered);
+  AWAIT_READY(registered);
 
   Future<DeactivateFrameworkMessage> deactivateFrameworkMessage =
     FUTURE_PROTOBUF(DeactivateFrameworkMessage(), _, _);
 
   ASSERT_EQ(DRIVER_ABORTED, driver.abort());
 
-  AWAIT_UNTIL(deactivateFrameworkMessage);
+  AWAIT_READY(deactivateFrameworkMessage);
 
   driver.stop();
   local::shutdown();
@@ -115,7 +115,7 @@ TEST(ExceptionTest, DisallowSchedulerAct
 
   driver.start();
 
-  AWAIT_UNTIL(registered);
+  AWAIT_READY(registered);
 
   EXPECT_CALL(sched, offerRescinded(&driver, _))
     .Times(AtMost(1));
@@ -152,7 +152,7 @@ TEST(ExceptionTest, DisallowSchedulerCal
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   // None of these callbacks should be invoked.
@@ -182,7 +182,7 @@ TEST(ExceptionTest, DisallowSchedulerCal
 
   process::post(message.get().to, rescindMessage);
 
-  AWAIT_UNTIL(rescindMsg);
+  AWAIT_READY(rescindMsg);
 
   Future<UnregisterFrameworkMessage> unregisterMsg =
     FUTURE_PROTOBUF(UnregisterFrameworkMessage(), _, _);
@@ -190,7 +190,7 @@ TEST(ExceptionTest, DisallowSchedulerCal
   driver.stop();
 
   //Ensures reception of RescindResourceOfferMessage.
-  AWAIT_UNTIL(unregisterMsg);
+  AWAIT_READY(unregisterMsg);
 
   local::shutdown();
 }

Modified: incubator/mesos/trunk/src/tests/files_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/files_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/files_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/files_tests.cpp Wed Apr 24 20:37:20 2013
@@ -55,15 +55,15 @@ TEST_F(FilesTest, AttachTest)
   ASSERT_SOME(os::write("file", "body"));
   ASSERT_SOME(os::mkdir("dir"));
 
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("file", "myname"));   // Valid file.
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("dir", "mydir"));     // Valid dir.
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("file", "myname"));   // Re-attach.
-  EXPECT_FUTURE_WILL_FAIL(files.attach("missing", "somename")); // Missing file.
+  AWAIT_EXPECT_READY(files.attach("file", "myname"));       // Valid file.
+  AWAIT_EXPECT_READY(files.attach("dir", "mydir"));         // Valid dir.
+  AWAIT_EXPECT_READY(files.attach("file", "myname"));       // Re-attach.
+  AWAIT_EXPECT_FAILED(files.attach("missing", "somename")); // Missing file.
 
   ASSERT_SOME(os::write("file2", "body"));
 
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("file2", "myname"));  // Overwrite.
-  EXPECT_FUTURE_WILL_FAIL(files.attach("$@", "foo"));           // Bad path.
+  AWAIT_EXPECT_READY(files.attach("file2", "myname"));  // Overwrite.
+  AWAIT_EXPECT_FAILED(files.attach("$@", "foo"));       // Bad path.
 }
 
 
@@ -72,7 +72,7 @@ TEST_F(FilesTest, DetachTest)
   Files files;
 
   ASSERT_SOME(os::write("file", "body"));
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("file", "myname"));
+  AWAIT_EXPECT_READY(files.attach("file", "myname"));
 
   files.detach("myname");
   files.detach("myname");
@@ -87,27 +87,29 @@ TEST_F(FilesTest, ReadTest)
   Future<Response> response =
     process::http::get(upid, "read.json");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(BadRequest().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ("Expecting 'path=value' in query.\n", response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(BadRequest().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(
+      "Expecting 'path=value' in query.\n",
+      response);
 
   response = process::http::get(upid, "read.json", "path=none&offset=hello");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(BadRequest().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(BadRequest().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(
       "Failed to parse offset: Failed to convert 'hello' to number.\n",
       response);
 
   response = process::http::get(upid, "read.json", "path=none&length=hello");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(BadRequest().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(BadRequest().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(
       "Failed to parse length: Failed to convert 'hello' to number.\n",
       response);
 
   // Now write a file.
   ASSERT_SOME(os::write("file", "body"));
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("file", "/myname"));
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("file", "myname"));
+  AWAIT_EXPECT_READY(files.attach("file", "/myname"));
+  AWAIT_EXPECT_READY(files.attach("file", "myname"));
 
   // Read a valid file.
   JSON::Object expected;
@@ -116,16 +118,16 @@ TEST_F(FilesTest, ReadTest)
 
   response = process::http::get(upid, "read.json", "path=/myname&offset=0");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(stringify(expected), response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
 
   response = process::http::get(upid, "read.json", "path=myname&offset=0");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(stringify(expected), response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
 
   // Missing file.
-  EXPECT_RESPONSE_STATUS_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(
       NotFound().status,
       process::http::get(upid, "read.json", "path=missing"));
 }
@@ -142,10 +144,10 @@ TEST_F(FilesTest, ResolveTest)
   ASSERT_SOME(os::write("1/2/three", "three"));
 
   // Attach some paths.
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("1", "one"));
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("1", "/one/"));
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("1/2", "two"));
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("1/2", "one/two"));
+  AWAIT_EXPECT_READY(files.attach("1", "one"));
+  AWAIT_EXPECT_READY(files.attach("1", "/one/"));
+  AWAIT_EXPECT_READY(files.attach("1/2", "two"));
+  AWAIT_EXPECT_READY(files.attach("1/2", "one/two"));
 
   // Resolve 1/2/3 via each attached path.
   JSON::Object expected;
@@ -155,53 +157,53 @@ TEST_F(FilesTest, ResolveTest)
   Future<Response> response =
     process::http::get(upid, "read.json", "path=one/2/three&offset=0");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(stringify(expected), response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
 
   response =
     process::http::get(upid, "read.json", "path=/one/2/three&offset=0");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(stringify(expected), response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
 
   response =
     process::http::get(upid, "read.json", "path=two/three&offset=0");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(stringify(expected), response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
 
   response =
     process::http::get(upid, "read.json", "path=one/two/three&offset=0");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(stringify(expected), response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
 
   // Percent encoded '/' urls.
   response =
     process::http::get(upid, "read.json", "path=%2Fone%2F2%2Fthree&offset=0");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(stringify(expected), response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
 
   response =
     process::http::get(upid, "read.json", "path=one%2Ftwo%2Fthree&offset=0");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(stringify(expected), response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
 
   // Reading dirs not allowed.
-  EXPECT_RESPONSE_STATUS_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(
       BadRequest().status,
       process::http::get(upid, "read.json", "path=one/2"));
-  EXPECT_RESPONSE_STATUS_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(
       BadRequest().status,
       process::http::get(upid, "read.json", "path=one"));
-  EXPECT_RESPONSE_STATUS_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(
       BadRequest().status,
       process::http::get(upid, "read.json", "path=one/"));
 
   // Breaking out of sandbox.
-  EXPECT_RESPONSE_STATUS_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(
       BadRequest().status,
       process::http::get(upid, "read.json", "path=two/../two"));
 }
@@ -217,7 +219,7 @@ TEST_F(FilesTest, BrowseTest)
   ASSERT_SOME(os::write("1/two", "two"));
   ASSERT_SOME(os::write("1/three", "three"));
 
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("1", "one"));
+  AWAIT_EXPECT_READY(files.attach("1", "one"));
 
   // Get the listing.
   struct stat s;
@@ -234,27 +236,27 @@ TEST_F(FilesTest, BrowseTest)
   Future<Response> response =
       process::http::get(upid, "browse.json", "path=one/");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(stringify(expected), response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
 
   response = process::http::get(upid, "browse.json", "path=one%2F");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(stringify(expected), response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
 
   response = process::http::get(upid, "browse.json", "path=one");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(stringify(expected), response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(expected), response);
 
   // Empty listing.
   response = process::http::get(upid, "browse.json", "path=one/2");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(stringify(JSON::Array()), response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(stringify(JSON::Array()), response);
 
   // Missing dir.
-  EXPECT_RESPONSE_STATUS_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(
       NotFound().status,
       process::http::get(upid, "browse.json", "path=missing"));
 }
@@ -276,20 +278,20 @@ TEST_F(FilesTest, DownloadTest)
 
   ASSERT_SOME(os::write("binary", "no file extension"));
   ASSERT_SOME(os::write("black.gif", data));
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("binary", "binary"));
-  EXPECT_FUTURE_WILL_SUCCEED(files.attach("black.gif", "black.gif"));
+  AWAIT_EXPECT_READY(files.attach("binary", "binary"));
+  AWAIT_EXPECT_READY(files.attach("black.gif", "black.gif"));
 
   Future<Response> response =
     process::http::get(upid, "download.json", "path=binary");
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_HEADER_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_HEADER_EQ(
       "application/octet-stream",
       "Content-Type",
       response);
-  EXPECT_RESPONSE_BODY_WILL_EQ("no file extension", response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ("no file extension", response);
 
   response = process::http::get(upid, "download.json", "path=black.gif");
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_HEADER_WILL_EQ("image/gif", "Content-Type", response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(data, response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_HEADER_EQ("image/gif", "Content-Type", response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(data, response);
 }

Modified: incubator/mesos/trunk/src/tests/gc_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/gc_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/gc_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/gc_tests.cpp Wed Apr 24 20:37:20 2013
@@ -116,17 +116,17 @@ TEST_F(GarbageCollectorTest, Schedule)
   Future<Nothing> schedule3 = gc.schedule(Seconds(15), file3);
 
   // Ensure the dispatches are completed before advancing the clock.
-  AWAIT_UNTIL(scheduleDispatch1);
-  AWAIT_UNTIL(scheduleDispatch2);
-  AWAIT_UNTIL(scheduleDispatch3);
+  AWAIT_READY(scheduleDispatch1);
+  AWAIT_READY(scheduleDispatch2);
+  AWAIT_READY(scheduleDispatch3);
   Clock::settle();
 
   // Advance the clock to trigger the GC of file1 and file2.
   Clock::advance(Seconds(10));
   Clock::settle();
 
-  ASSERT_FUTURE_WILL_SUCCEED(schedule1);
-  ASSERT_FUTURE_WILL_SUCCEED(schedule2);
+  AWAIT_READY(schedule1);
+  AWAIT_READY(schedule2);
   ASSERT_TRUE(schedule3.isPending());
 
   EXPECT_FALSE(os::exists(file1));
@@ -137,7 +137,7 @@ TEST_F(GarbageCollectorTest, Schedule)
   Clock::advance(Seconds(5));
   Clock::settle();
 
-  ASSERT_FUTURE_WILL_SUCCEED(schedule3);
+  AWAIT_READY(schedule3);
 
   EXPECT_FALSE(os::exists(file3));
 
@@ -150,7 +150,7 @@ TEST_F(GarbageCollectorTest, Unschedule)
   GarbageCollector gc;
 
   // Attempt to unschedule a file that is not scheduled.
-  ASSERT_FUTURE_WILL_EQ(false, gc.unschedule("bogus"));
+  AWAIT_ASSERT_EQ(false, gc.unschedule("bogus"));
 
   // Make some temporary files to gc.
   const string& file1 = "file1";
@@ -173,18 +173,18 @@ TEST_F(GarbageCollectorTest, Unschedule)
   Future<Nothing> schedule3 = gc.schedule(Seconds(10), file3);
 
   // Unschedule each operation.
-  ASSERT_FUTURE_WILL_EQ(true, gc.unschedule(file2));
-  ASSERT_FUTURE_WILL_EQ(true, gc.unschedule(file3));
-  ASSERT_FUTURE_WILL_EQ(true, gc.unschedule(file1));
+  AWAIT_ASSERT_EQ(true, gc.unschedule(file2));
+  AWAIT_ASSERT_EQ(true, gc.unschedule(file3));
+  AWAIT_ASSERT_EQ(true, gc.unschedule(file1));
 
   // Advance the clock to ensure nothing was GCed.
   Clock::advance(Seconds(10));
   Clock::settle();
 
   // The unscheduling will have discarded the GC futures.
-  ASSERT_FUTURE_WILL_DISCARD(schedule1);
-  ASSERT_FUTURE_WILL_DISCARD(schedule2);
-  ASSERT_FUTURE_WILL_DISCARD(schedule3);
+  AWAIT_DISCARDED(schedule1);
+  AWAIT_DISCARDED(schedule2);
+  AWAIT_DISCARDED(schedule3);
 
   EXPECT_TRUE(os::exists(file1));
   EXPECT_TRUE(os::exists(file2));
@@ -221,14 +221,14 @@ TEST_F(GarbageCollectorTest, Prune)
   Future<Nothing> schedule3 = gc.schedule(Seconds(15), file3);
   Future<Nothing> schedule4 = gc.schedule(Seconds(15), file4);
 
-  ASSERT_FUTURE_WILL_EQ(true, gc.unschedule(file3));
-  ASSERT_FUTURE_WILL_DISCARD(schedule3);
+  AWAIT_ASSERT_EQ(true, gc.unschedule(file3));
+  AWAIT_DISCARDED(schedule3);
 
   // Prune file1 and file2.
   gc.prune(Seconds(10));
 
-  ASSERT_FUTURE_WILL_SUCCEED(schedule1);
-  ASSERT_FUTURE_WILL_SUCCEED(schedule2);
+  AWAIT_READY(schedule1);
+  AWAIT_READY(schedule2);
   ASSERT_TRUE(schedule4.isPending());
 
   // Both file1 and file2 will have been removed.
@@ -240,7 +240,7 @@ TEST_F(GarbageCollectorTest, Prune)
   // Prune file4.
   gc.prune(Seconds(15));
 
-  ASSERT_FUTURE_WILL_SUCCEED(schedule4);
+  AWAIT_READY(schedule4);
 
   EXPECT_FALSE(os::exists(file4));
 
@@ -266,7 +266,7 @@ TEST_F(GarbageCollectorIntegrationTest, 
   Try<PID<Slave> > slave = cluster.slaves.start(DEFAULT_EXECUTOR_ID, &exec);
   ASSERT_SOME(slave);
 
-  AWAIT_UNTIL(slaveRegisteredMessage);
+  AWAIT_READY(slaveRegisteredMessage);
 
   MockScheduler sched;
   MesosSchedulerDriver driver(&sched, DEFAULT_FRAMEWORK_INFO, master.get());
@@ -294,7 +294,7 @@ TEST_F(GarbageCollectorIntegrationTest, 
 
   driver.start();
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(TASK_RUNNING, status.get().state());
 
   // Make sure directory exists. Need to do this AFTER getting a
@@ -322,9 +322,9 @@ TEST_F(GarbageCollectorIntegrationTest, 
 
   cluster.slaves.stop(slave.get());
 
-  AWAIT_UNTIL(shutdown); // Ensures MockExecutor can be deallocated.
+  AWAIT_READY(shutdown); // Ensures MockExecutor can be deallocated.
 
-  AWAIT_UNTIL(slaveLost);
+  AWAIT_READY(slaveLost);
 
   Future<Nothing> schedule =
     FUTURE_DISPATCH(_, &GarbageCollectorProcess::schedule);
@@ -332,7 +332,7 @@ TEST_F(GarbageCollectorIntegrationTest, 
   slave = cluster.slaves.start();
   ASSERT_SOME(slave);
 
-  AWAIT_UNTIL(schedule);
+  AWAIT_READY(schedule);
 
   Clock::settle(); // Wait for GarbageCollectorProcess::schedule to complete.
 
@@ -492,9 +492,9 @@ TEST_F(GarbageCollectorIntegrationTest, 
 
   driver.start();
 
-  AWAIT_UNTIL(frameworkId);
+  AWAIT_READY(frameworkId);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(TASK_RUNNING, status.get().state());
 
   const std::string& executorDir = isolator.directories[DEFAULT_EXECUTOR_ID];
@@ -502,7 +502,7 @@ TEST_F(GarbageCollectorIntegrationTest, 
   ASSERT_TRUE(os::exists(executorDir));
 
   process::UPID files("files", process::ip(), process::port());
-  EXPECT_RESPONSE_STATUS_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(
       process::http::OK().status,
       process::http::get(files, "browse.json", "path=" + executorDir));
 
@@ -520,7 +520,7 @@ TEST_F(GarbageCollectorIntegrationTest, 
   // TODO(benh): WTF? Why aren't we dispatching?
   isolator.killExecutor(frameworkId.get(), DEFAULT_EXECUTOR_ID);
 
-  AWAIT_UNTIL(schedule);
+  AWAIT_READY(schedule);
 
   Clock::settle(); // Wait for GarbageCollectorProcess::schedule to complete.
 
@@ -530,7 +530,7 @@ TEST_F(GarbageCollectorIntegrationTest, 
 
   // Executor's directory should be gc'ed by now.
   ASSERT_FALSE(os::exists(executorDir));
-  EXPECT_RESPONSE_STATUS_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(
       process::http::NotFound().status,
       process::http::get(files, "browse.json", "path=" + executorDir));
 
@@ -584,9 +584,9 @@ TEST_F(GarbageCollectorIntegrationTest, 
 
   driver.start();
 
-  AWAIT_UNTIL(frameworkId);
+  AWAIT_READY(frameworkId);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(TASK_RUNNING, status.get().state());
 
   const std::string& executorDir = isolator.directories[DEFAULT_EXECUTOR_ID];
@@ -594,7 +594,7 @@ TEST_F(GarbageCollectorIntegrationTest, 
   ASSERT_TRUE(os::exists(executorDir));
 
   process::UPID files("files", process::ip(), process::port());
-  EXPECT_RESPONSE_STATUS_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(
       process::http::OK().status,
       process::http::get(files, "browse.json", "path=" + executorDir));
 
@@ -612,7 +612,7 @@ TEST_F(GarbageCollectorIntegrationTest, 
   // TODO(benh): WTF? Why aren't we dispatching?
   isolator.killExecutor(frameworkId.get(), DEFAULT_EXECUTOR_ID);
 
-  AWAIT_UNTIL(schedule);
+  AWAIT_READY(schedule);
 
   Clock::settle(); // Wait for GarbageCollectorProcess::schedule to complete.
 
@@ -622,13 +622,13 @@ TEST_F(GarbageCollectorIntegrationTest, 
   // Simulate a disk full message to the slave.
   process::dispatch(slave.get(), &Slave::_checkDiskUsage, Try<double>::some(1));
 
-  AWAIT_UNTIL(_checkDiskUsage);
+  AWAIT_READY(_checkDiskUsage);
 
   Clock::settle(); // Wait for Slave::_checkDiskUsage to complete.
 
   // Executor's directory should be gc'ed by now.
   ASSERT_FALSE(os::exists(executorDir));
-  EXPECT_RESPONSE_STATUS_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(
       process::http::NotFound().status,
       process::http::get(files, "browse.json", "path=" + executorDir));
 

Modified: incubator/mesos/trunk/src/tests/logging_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/logging_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/logging_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/logging_tests.cpp Wed Apr 24 20:37:20 2013
@@ -43,40 +43,40 @@ TEST(LoggingTest, Toggle)
 
   process::Future<Response> response = process::http::get(pid, "toggle");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
 
   response = process::http::get(pid, "toggle", "level=0");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(BadRequest().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(BadRequest().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(
       "Expecting 'duration=value' in query.\n",
       response);
 
   response = process::http::get(pid, "toggle", "duration=10secs");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(BadRequest().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(BadRequest().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(
       "Expecting 'level=value' in query.\n",
       response);
 
   response = process::http::get(pid, "toggle", "duration=10secs");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(BadRequest().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(BadRequest().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(
       "Expecting 'level=value' in query.\n",
       response);
 
   response = process::http::get(pid, "toggle", "level=-1&duration=10secs");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(BadRequest().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(BadRequest().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(
       "Invalid level '-1'.\n",
       response);
 
   response = process::http::get(pid, "toggle", "level=-1&duration=10secs");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(BadRequest().status, response);
-  EXPECT_RESPONSE_BODY_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(BadRequest().status, response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(
       "Invalid level '-1'.\n",
       response);
 }

Modified: incubator/mesos/trunk/src/tests/master_detector_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/master_detector_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/master_detector_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/master_detector_tests.cpp Wed Apr 24 20:37:20 2013
@@ -93,7 +93,7 @@ TEST_F(MasterDetectorTest, File)
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
 
   driver.stop();
   driver.join();

Modified: incubator/mesos/trunk/src/tests/master_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/master_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/master_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/master_tests.cpp Wed Apr 24 20:37:20 2013
@@ -102,7 +102,7 @@ TEST_F(MasterTest, TaskRunning)
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   TaskInfo task;
@@ -132,10 +132,10 @@ TEST_F(MasterTest, TaskRunning)
 
   driver.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(TASK_RUNNING, status.get().state());
 
-  AWAIT_UNTIL(resourcesChanged);
+  AWAIT_READY(resourcesChanged);
 
   Future<Nothing> shutdown;
   EXPECT_CALL(exec, shutdown(_))
@@ -144,7 +144,7 @@ TEST_F(MasterTest, TaskRunning)
   driver.stop();
   driver.join();
 
-  AWAIT_UNTIL(shutdown); // Ensures MockExecutor can be deallocated.
+  AWAIT_READY(shutdown); // Ensures MockExecutor can be deallocated.
 
   cluster.shutdown(); // Must shutdown before 'isolator' gets deallocated.
 }
@@ -179,7 +179,7 @@ TEST_F(MasterTest, ShutdownFrameworkWhil
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   TaskInfo task;
@@ -209,10 +209,10 @@ TEST_F(MasterTest, ShutdownFrameworkWhil
 
   driver.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(TASK_RUNNING, status.get().state());
 
-  AWAIT_UNTIL(resourcesChanged);
+  AWAIT_READY(resourcesChanged);
 
   Future<Nothing> shutdown;
   EXPECT_CALL(exec, shutdown(_))
@@ -221,7 +221,7 @@ TEST_F(MasterTest, ShutdownFrameworkWhil
   driver.stop();
   driver.join();
 
-  AWAIT_UNTIL(shutdown); // Ensures MockExecutor can be deallocated.
+  AWAIT_READY(shutdown); // Ensures MockExecutor can be deallocated.
 
   cluster.shutdown(); // Must shutdown before 'isolator' gets deallocated.
 }
@@ -252,7 +252,7 @@ TEST_F(MasterTest, KillTask)
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   TaskID taskId;
@@ -280,7 +280,7 @@ TEST_F(MasterTest, KillTask)
 
   driver.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(TASK_RUNNING, status.get().state());
 
   EXPECT_CALL(exec, killTask(_, _))
@@ -291,7 +291,7 @@ TEST_F(MasterTest, KillTask)
 
   driver.killTask(taskId);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(TASK_KILLED, status.get().state());
 
   Future<Nothing> shutdown;
@@ -301,7 +301,7 @@ TEST_F(MasterTest, KillTask)
   driver.stop();
   driver.join();
 
-  AWAIT_UNTIL(shutdown); // To ensure can deallocate MockExecutor.
+  AWAIT_READY(shutdown); // To ensure can deallocate MockExecutor.
 
   cluster.shutdown();
 }
@@ -332,7 +332,7 @@ TEST_F(MasterTest, StatusUpdateAck)
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   TaskInfo task;
@@ -360,11 +360,11 @@ TEST_F(MasterTest, StatusUpdateAck)
 
   driver.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(TASK_RUNNING, status.get().state());
 
   // Ensure the slave gets a status update ACK.
-  AWAIT_UNTIL(acknowledgement);
+  AWAIT_READY(acknowledgement);
 
   Future<Nothing> shutdown;
   EXPECT_CALL(exec, shutdown(_))
@@ -373,7 +373,7 @@ TEST_F(MasterTest, StatusUpdateAck)
   driver.stop();
   driver.join();
 
-  AWAIT_UNTIL(shutdown); // Ensures MockExecutor can be deallocated.
+  AWAIT_READY(shutdown); // Ensures MockExecutor can be deallocated.
 
   cluster.shutdown();
 }
@@ -408,7 +408,7 @@ TEST_F(MasterTest, RecoverResources)
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   ExecutorInfo executorInfo;
@@ -445,7 +445,7 @@ TEST_F(MasterTest, RecoverResources)
 
   driver.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(TASK_RUNNING, status.get().state());
 
   EXPECT_CALL(exec, killTask(_, _))
@@ -460,12 +460,12 @@ TEST_F(MasterTest, RecoverResources)
 
   driver.killTask(taskId);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(TASK_KILLED, status.get().state());
 
   driver.reviveOffers(); // Don't wait till the next allocation.
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   Offer offer = offers.get()[0];
@@ -485,7 +485,7 @@ TEST_F(MasterTest, RecoverResources)
   // should wait for the allocator to recover the resources first. See
   // the allocator tests for inspiration.
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
   Resources slaveResources = Resources::parse(flags.resources.get());
   EXPECT_EQ(slaveResources, offers.get()[0].resources());
@@ -527,7 +527,7 @@ TEST_F(MasterTest, FrameworkMessage)
 
   schedDriver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   TaskInfo task;
@@ -553,7 +553,7 @@ TEST_F(MasterTest, FrameworkMessage)
 
   schedDriver.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(TASK_RUNNING, status.get().state());
 
   Future<string> execData;
@@ -563,7 +563,7 @@ TEST_F(MasterTest, FrameworkMessage)
   schedDriver.sendFrameworkMessage(
       DEFAULT_EXECUTOR_ID, offers.get()[0].slave_id(), "hello");
 
-  AWAIT_UNTIL(execData);
+  AWAIT_READY(execData);
   EXPECT_EQ("hello", execData.get());
 
   Future<string> schedData;
@@ -572,7 +572,7 @@ TEST_F(MasterTest, FrameworkMessage)
 
   execDriver.get()->sendFrameworkMessage("world");
 
-  AWAIT_UNTIL(schedData);
+  AWAIT_READY(schedData);
   EXPECT_EQ("world", schedData.get());
 
   Future<Nothing> shutdown;
@@ -582,7 +582,7 @@ TEST_F(MasterTest, FrameworkMessage)
   schedDriver.stop();
   schedDriver.join();
 
-  AWAIT_UNTIL(shutdown); // To ensure can deallocate MockExecutor.
+  AWAIT_READY(shutdown); // To ensure can deallocate MockExecutor.
 
   cluster.shutdown();
 }
@@ -626,7 +626,7 @@ TEST_F(MasterTest, MultipleExecutors)
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   ASSERT_NE(0u, offers.get().size());
 
   ExecutorInfo executor1; // Bug in gcc 4.1.*, must assign on next line.
@@ -676,16 +676,16 @@ TEST_F(MasterTest, MultipleExecutors)
 
   driver.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(exec1Task);
+  AWAIT_READY(exec1Task);
   EXPECT_EQ(task1.task_id(), exec1Task.get().task_id());
 
-  AWAIT_UNTIL(exec2Task);
+  AWAIT_READY(exec2Task);
   EXPECT_EQ(task2.task_id(), exec2Task.get().task_id());
 
-  AWAIT_UNTIL(status1);
+  AWAIT_READY(status1);
   EXPECT_EQ(TASK_RUNNING, status1.get().state());
 
-  AWAIT_UNTIL(status2);
+  AWAIT_READY(status2);
   EXPECT_EQ(TASK_RUNNING, status2.get().state());
 
   Future<Nothing> shutdown1;
@@ -699,8 +699,8 @@ TEST_F(MasterTest, MultipleExecutors)
   driver.stop();
   driver.join();
 
-  AWAIT_UNTIL(shutdown1); // To ensure can deallocate MockExecutor.
-  AWAIT_UNTIL(shutdown2); // To ensure can deallocate MockExecutor.
+  AWAIT_READY(shutdown1); // To ensure can deallocate MockExecutor.
+  AWAIT_READY(shutdown2); // To ensure can deallocate MockExecutor.
 
   cluster.shutdown(); // Must shutdown before 'isolator' gets deallocated.
 }
@@ -731,7 +731,7 @@ TEST_F(MasterTest, ShutdownUnregisteredE
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   // Launch a task with the command executor.
@@ -755,7 +755,7 @@ TEST_F(MasterTest, ShutdownUnregisteredE
 
   driver.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(registerExecutor);
+  AWAIT_READY(registerExecutor);
 
   Clock::pause();
 
@@ -769,7 +769,7 @@ TEST_F(MasterTest, ShutdownUnregisteredE
 
   Clock::advance(cluster.slaves.flags.executor_registration_timeout);
 
-  AWAIT_UNTIL(killExecutor);
+  AWAIT_READY(killExecutor);
 
   Clock::settle(); // Wait for ProcessIsolator::killExecutor to complete.
 
@@ -813,7 +813,7 @@ TEST_F(MasterTest, MasterInfo)
 
   driver.start();
 
-  AWAIT_UNTIL(masterInfo);
+  AWAIT_READY(masterInfo);
   EXPECT_EQ(master.get().port, masterInfo.get().port());
   EXPECT_EQ(master.get().ip, masterInfo.get().ip());
 
@@ -848,7 +848,7 @@ TEST_F(MasterTest, MasterInfoOnReElectio
 
   driver.start();
 
-  AWAIT_UNTIL(message);
+  AWAIT_READY(message);
 
   // Simulate a spurious newMasterDetected event (e.g., due to ZooKeeper
   // expiration) at the scheduler.
@@ -861,7 +861,7 @@ TEST_F(MasterTest, MasterInfoOnReElectio
 
   process::post(message.get().to, newMasterDetectedMsg);
 
-  AWAIT_UNTIL(masterInfo);
+  AWAIT_READY(masterInfo);
   EXPECT_EQ(master.get().port, masterInfo.get().port());
   EXPECT_EQ(master.get().ip, masterInfo.get().ip());
 
@@ -917,7 +917,7 @@ TEST_F(WhitelistTest, WhitelistSlave)
 
   driver.start();
 
-  AWAIT_UNTIL(offers); // Implies the slave has registered.
+  AWAIT_READY(offers); // Implies the slave has registered.
 
   driver.stop();
   driver.join();
@@ -950,7 +950,7 @@ TEST_F(MasterTest, MasterLost)
 
   driver.start();
 
-  AWAIT_UNTIL(message);
+  AWAIT_READY(message);
 
   Future<Nothing> disconnected;
   EXPECT_CALL(sched, disconnected(&driver))
@@ -959,7 +959,7 @@ TEST_F(MasterTest, MasterLost)
   // Simulate a spurious noMasterDetected event at the scheduler.
   process::post(message.get().to, NoMasterDetectedMessage());
 
-  AWAIT_UNTIL(disconnected);
+  AWAIT_READY(disconnected);
 
   driver.stop();
   driver.join();

Modified: incubator/mesos/trunk/src/tests/monitor_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/monitor_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/monitor_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/monitor_tests.cpp Wed Apr 24 20:37:20 2013
@@ -105,14 +105,14 @@ TEST(MonitorTest, WatchUnwatch)
 
   Future<Response> response = process::http::get(upid, "usage.json");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_HEADER_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_HEADER_EQ(
       "application/json",
       "Content-Type",
       response);
 
   // TODO(bmahler): Verify metering directly through statistics.
-  EXPECT_RESPONSE_BODY_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_BODY_EQ(
       strings::format(
           "[{"
               "\"executor_id\":\"executor\","
@@ -143,10 +143,10 @@ TEST(MonitorTest, WatchUnwatch)
 
   response = process::http::get(upid, "usage.json");
 
-  EXPECT_RESPONSE_STATUS_WILL_EQ(OK().status, response);
-  EXPECT_RESPONSE_HEADER_WILL_EQ(
+  AWAIT_EXPECT_RESPONSE_STATUS_EQ(OK().status, response);
+  AWAIT_EXPECT_RESPONSE_HEADER_EQ(
       "application/json",
       "Content-Type",
       response);
-  EXPECT_RESPONSE_BODY_WILL_EQ("[]", response);
+  AWAIT_EXPECT_RESPONSE_BODY_EQ("[]", response);
 }

Modified: incubator/mesos/trunk/src/tests/resource_offers_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/resource_offers_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/resource_offers_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/resource_offers_tests.cpp Wed Apr 24 20:37:20 2013
@@ -70,7 +70,7 @@ TEST(ResourceOffersTest, ResourceOfferWi
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
   EXPECT_GE(10u, offers.get().size());
 
@@ -104,7 +104,7 @@ TEST(ResourceOffersTest, TaskUsesNoResou
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   TaskInfo task;
@@ -122,7 +122,7 @@ TEST(ResourceOffersTest, TaskUsesNoResou
 
   driver.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(task.task_id(), status.get().task_id());
   EXPECT_EQ(TASK_LOST, status.get().state());
   EXPECT_TRUE(status.get().has_message());
@@ -154,7 +154,7 @@ TEST(ResourceOffersTest, TaskUsesInvalid
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   TaskInfo task;
@@ -177,7 +177,7 @@ TEST(ResourceOffersTest, TaskUsesInvalid
 
   driver.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(task.task_id(), status.get().task_id());
   EXPECT_EQ(TASK_LOST, status.get().state());
   EXPECT_TRUE(status.get().has_message());
@@ -209,7 +209,7 @@ TEST(ResourceOffersTest, TaskUsesMoreRes
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   TaskInfo task;
@@ -232,7 +232,7 @@ TEST(ResourceOffersTest, TaskUsesMoreRes
 
   driver.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
 
   EXPECT_EQ(task.task_id(), status.get().task_id());
   EXPECT_EQ(TASK_LOST, status.get().state());
@@ -264,7 +264,7 @@ TEST(ResourceOffersTest, ResourcesGetReo
 
   driver1.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   driver1.stop();
@@ -281,7 +281,7 @@ TEST(ResourceOffersTest, ResourcesGetReo
 
   driver2.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
 
   driver2.stop();
   driver2.join();
@@ -308,7 +308,7 @@ TEST(ResourceOffersTest, ResourcesGetReo
 
   driver1.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   vector<TaskInfo> tasks; // Use nothing!
@@ -325,7 +325,7 @@ TEST(ResourceOffersTest, ResourcesGetReo
 
   driver2.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
 
   // Stop first framework before second so no offers are sent.
   driver1.stop();
@@ -357,7 +357,7 @@ TEST(ResourceOffersTest, ResourcesGetReo
 
   driver1.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   TaskInfo task;
@@ -385,7 +385,7 @@ TEST(ResourceOffersTest, ResourcesGetReo
 
   driver1.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(task.task_id(), status.get().task_id());
   EXPECT_EQ(TASK_LOST, status.get().state());
   EXPECT_TRUE(status.get().has_message());
@@ -403,7 +403,7 @@ TEST(ResourceOffersTest, ResourcesGetReo
 
   driver2.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
 
   driver1.stop();
   driver1.join();
@@ -448,7 +448,7 @@ TEST(ResourceOffersTest, Request)
 
   driver.start();
 
-  AWAIT_UNTIL(registered);
+  AWAIT_READY(registered);
 
   vector<Request> sent;
   Request request;
@@ -461,7 +461,7 @@ TEST(ResourceOffersTest, Request)
 
   driver.requestResources(sent);
 
-  AWAIT_UNTIL(received);
+  AWAIT_READY(received);
   EXPECT_EQ(sent.size(), received.get().size());
   EXPECT_NE(0u, received.get().size());
   EXPECT_EQ(request.slave_id(), received.get()[0].slave_id());
@@ -507,7 +507,7 @@ TEST_F(MultipleExecutorsTest, TasksExecu
 
   driver.start();
 
-  AWAIT_UNTIL(offers);
+  AWAIT_READY(offers);
   EXPECT_NE(0u, offers.get().size());
 
   ExecutorInfo executor;
@@ -548,10 +548,10 @@ TEST_F(MultipleExecutorsTest, TasksExecu
 
   driver.launchTasks(offers.get()[0].id(), tasks);
 
-  AWAIT_UNTIL(task);
+  AWAIT_READY(task);
   EXPECT_EQ(task1.task_id(), task.get().task_id());
 
-  AWAIT_UNTIL(status);
+  AWAIT_READY(status);
   EXPECT_EQ(task2.task_id(), status.get().task_id());
   EXPECT_EQ(TASK_LOST, status.get().state());
   EXPECT_TRUE(status.get().has_message());
@@ -566,7 +566,7 @@ TEST_F(MultipleExecutorsTest, TasksExecu
   driver.stop();
   driver.join();
 
-  AWAIT_UNTIL(shutdown); // To ensure can deallocate MockExecutor.
+  AWAIT_READY(shutdown); // To ensure can deallocate MockExecutor.
 
   cluster.shutdown();
 }

Modified: incubator/mesos/trunk/src/tests/slave_recovery_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/slave_recovery_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/slave_recovery_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/slave_recovery_tests.cpp Wed Apr 24 20:37:20 2013
@@ -1152,7 +1152,7 @@ TYPED_TEST(SlaveRecoveryTest, ShutdownSl
   this->startSlave();
 
   // Ensure that the slave registered with a new id.
-  AWAIT_UNTIL(offers2);
+  AWAIT_READY(offers2);
 
   EXPECT_NE(0u, offers2.get().size());
 

Modified: incubator/mesos/trunk/src/tests/state_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/state_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/state_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/state_tests.cpp Wed Apr 24 20:37:20 2013
@@ -54,7 +54,7 @@ using namespace process;
 void GetSetGet(State<ProtobufSerializer>* state)
 {
   Future<Variable<Slaves> > variable = state->get<Slaves>("slaves");
-  ASSERT_FUTURE_WILL_SUCCEED(variable);
+  AWAIT_READY(variable);
 
   Variable<Slaves> slaves1 = variable.get();
   EXPECT_TRUE(slaves1->infos().size() == 0);
@@ -89,7 +89,7 @@ void GetSetGet(State<ProtobufSerializer>
 void GetSetSetGet(State<ProtobufSerializer>* state)
 {
   Future<Variable<Slaves> > variable = state->get<Slaves>("slaves");
-  ASSERT_FUTURE_WILL_SUCCEED(variable);
+  AWAIT_READY(variable);
 
   Variable<Slaves> slaves1 = variable.get();
   EXPECT_TRUE(slaves1->infos().size() == 0);
@@ -133,13 +133,13 @@ void GetSetSetGet(State<ProtobufSerializ
 void GetGetSetSetGet(State<ProtobufSerializer>* state)
 {
   Future<Variable<Slaves> > variable = state->get<Slaves>("slaves");
-  ASSERT_FUTURE_WILL_SUCCEED(variable);
+  AWAIT_READY(variable);
 
   Variable<Slaves> slaves1 = variable.get();
   EXPECT_TRUE(slaves1->infos().size() == 0);
 
   variable = state->get<Slaves>("slaves");
-  ASSERT_FUTURE_WILL_SUCCEED(variable);
+  AWAIT_READY(variable);
 
   Variable<Slaves> slaves2 = variable.get();
   EXPECT_TRUE(slaves2->infos().size() == 0);
@@ -164,11 +164,11 @@ void GetGetSetSetGet(State<ProtobufSeria
   slaves1->add_infos()->MergeFrom(info1);
 
   result = state->set(slaves1);
-  ASSERT_FUTURE_WILL_SUCCEED(result);
+  AWAIT_READY(result);
   EXPECT_TRUE(result.get().isNone());
 
   variable = state->get<Slaves>("slaves");
-  ASSERT_FUTURE_WILL_SUCCEED(variable);
+  AWAIT_READY(variable);
 
   slaves1 = variable.get();
 
@@ -181,7 +181,7 @@ void GetGetSetSetGet(State<ProtobufSeria
 void Names(State<ProtobufSerializer>* state)
 {
   Future<Variable<Slaves> > variable = state->get<Slaves>("slaves");
-  ASSERT_FUTURE_WILL_SUCCEED(variable);
+  AWAIT_READY(variable);
 
   Variable<Slaves> slaves1 = variable.get();
   EXPECT_TRUE(slaves1->infos().size() == 0);

Modified: incubator/mesos/trunk/src/tests/utils.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/utils.hpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/utils.hpp (original)
+++ incubator/mesos/trunk/src/tests/utils.hpp Wed Apr 24 20:37:20 2013
@@ -200,12 +200,12 @@ public:
   {
     // Clean up the testing hierarchy, in case it wasn't cleaned up
     // properly from previous tests.
-    ASSERT_FUTURE_WILL_SUCCEED(cgroups::cleanup(TEST_CGROUPS_HIERARCHY));
+    AWAIT_READY(cgroups::cleanup(TEST_CGROUPS_HIERARCHY));
   }
 
   static void TearDownTestCase()
   {
-    ASSERT_FUTURE_WILL_SUCCEED(cgroups::cleanup(TEST_CGROUPS_HIERARCHY));
+    AWAIT_READY(cgroups::cleanup(TEST_CGROUPS_HIERARCHY));
   }
 
 protected:
@@ -345,11 +345,11 @@ ACTION_P3(LaunchTasks, tasks, cpus, mem)
     for (int j = 0; j < offer.resources_size(); j++) {
       const Resource& resource = offer.resources(j);
       if (resource.name() == "cpus" &&
-	        resource.type() == Value::SCALAR) {
-	      offeredCpus = resource.scalar().value();
+          resource.type() == Value::SCALAR) {
+        offeredCpus = resource.scalar().value();
       } else if (resource.name() == "mem" &&
-		             resource.type() == Value::SCALAR) {
-	      offeredMem = resource.scalar().value();
+                 resource.type() == Value::SCALAR) {
+        offeredMem = resource.scalar().value();
       }
     }
 
@@ -729,28 +729,6 @@ ACTION_P(SendStatusUpdateFromTaskID, sta
 }
 
 
-#define AWAIT_FOR(future, duration)             \
-  ASSERT_TRUE(future.await(duration))
-
-
-#define AWAIT_UNTIL(future)                     \
-  AWAIT_FOR(future, Seconds(2))
-
-
-// TODO(vinod): Combine this with ASSERT_FUTURE_WILL_SUCCEED
-// inside libprocess gtest.hpp.
-#define AWAIT_FOR_READY(future, duration)         \
-  ASSERT_TRUE(future.await(duration));            \
-  ASSERT_TRUE(future.isReady())                   \
-
-
-// TODO(vinod): Combine this with ASSERT_FUTURE_WILL_SUCCEED
-// inside libprocess gtest.hpp.
-#define AWAIT_READY(future)                     \
-  ASSERT_TRUE(future.await(Seconds(2)));        \
-  ASSERT_TRUE(future.isReady())                 \
-
-
 #define FUTURE_PROTOBUF(message, from, to)              \
   FutureProtobuf(message, from, to)
 

Modified: incubator/mesos/trunk/src/tests/zookeeper_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/zookeeper_tests.cpp?rev=1471653&r1=1471652&r2=1471653&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/zookeeper_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/zookeeper_tests.cpp Wed Apr 24 20:37:20 2013
@@ -199,7 +199,7 @@ TEST_F(ZooKeeperTest, MasterDetector)
 
   ASSERT_SOME(detector);
 
-  AWAIT_UNTIL(newMasterDetected);
+  AWAIT_READY(newMasterDetected);
 
   MasterDetector::destroy(detector.get());
 
@@ -224,7 +224,7 @@ TEST_F(ZooKeeperTest, MasterDetectors)
 
   ASSERT_SOME(detector1);
 
-  AWAIT_UNTIL(newMasterDetected1);
+  AWAIT_READY(newMasterDetected1);
 
   MockMasterDetectorListenerProcess mock2;
   process::spawn(mock2);
@@ -238,7 +238,7 @@ TEST_F(ZooKeeperTest, MasterDetectors)
 
   ASSERT_SOME(detector2);
 
-  AWAIT_UNTIL(newMasterDetected2);
+  AWAIT_READY(newMasterDetected2);
 
   // Destroying detector1 (below) might cause another election so we
   // need to set up expectations appropriately.
@@ -275,7 +275,7 @@ TEST_F(ZooKeeperTest, MasterDetectorShut
 
   ASSERT_SOME(detector);
 
-  AWAIT_UNTIL(newMasterDetected1);
+  AWAIT_READY(newMasterDetected1);
 
   Future<Nothing> noMasterDetected;
   EXPECT_CALL(mock, noMasterDetected())
@@ -285,7 +285,7 @@ TEST_F(ZooKeeperTest, MasterDetectorShut
 
   Clock::advance(Seconds(10)); // TODO(benh): Get session timeout from detector.
 
-  AWAIT_UNTIL(noMasterDetected);
+  AWAIT_READY(noMasterDetected);
 
   Future<Nothing> newMasterDetected2;
   EXPECT_CALL(mock, newMasterDetected(mock.self()))
@@ -293,7 +293,7 @@ TEST_F(ZooKeeperTest, MasterDetectorShut
 
   server->startNetwork();
 
-  AWAIT_FOR(newMasterDetected2, Seconds(5)); // ZooKeeper needs extra time.
+  AWAIT_READY_FOR(newMasterDetected2, Seconds(5)); // ZooKeeper needs time.
 
   MasterDetector::destroy(detector.get());
 
@@ -330,7 +330,7 @@ TEST_F(ZooKeeperTest, MasterDetectorExpi
   ZooKeeperMasterDetector leaderDetector(
       url.get(), leader.self(), true, true);
 
-  AWAIT_UNTIL(newMasterDetected1);
+  AWAIT_READY(newMasterDetected1);
 
   // Simulate a following master.
   MockMasterDetectorListenerProcess follower;
@@ -352,17 +352,17 @@ TEST_F(ZooKeeperTest, MasterDetectorExpi
       true,
       true);
 
-  AWAIT_UNTIL(newMasterDetected3);
+  AWAIT_READY(newMasterDetected3);
 
   // Now expire the leader's zk session.
   process::Future<int64_t> session = leaderDetector.session();
-  ASSERT_FUTURE_WILL_SUCCEED(session);
+  AWAIT_READY(session);
 
   server->expireSession(session.get());
 
   // Wait for session expiration and ensure we receive a
   // NewMasterDetected message.
-  AWAIT_FOR(newMasterDetected2, Seconds(5)); // ZooKeeper needs extra time.
+  AWAIT_READY_FOR(newMasterDetected2, Seconds(5)); // ZooKeeper needs time.
 
   process::terminate(follower);
   process::wait(follower);
@@ -398,7 +398,7 @@ TEST_F(ZooKeeperTest, MasterDetectorExpi
   ZooKeeperMasterDetector masterDetector(
       url.get(), master.self(), true, true);
 
-  AWAIT_UNTIL(newMasterDetected1);
+  AWAIT_READY(newMasterDetected1);
 
   // Simulate a slave.
   MockMasterDetectorListenerProcess slave;
@@ -417,11 +417,11 @@ TEST_F(ZooKeeperTest, MasterDetectorExpi
   ZooKeeperMasterDetector slaveDetector(
       url.get(), slave.self(), false, true);
 
-  AWAIT_UNTIL(newMasterDetected2);
+  AWAIT_READY(newMasterDetected2);
 
   // Now expire the slave's zk session.
   process::Future<int64_t> session = slaveDetector.session();
-  ASSERT_FUTURE_WILL_SUCCEED(session);
+  AWAIT_READY(session);
 
   server->expireSession(session.get());
 
@@ -463,7 +463,7 @@ TEST_F(ZooKeeperTest, MasterDetectorExpi
   ZooKeeperMasterDetector masterDetector1(
       url.get(), master1.self(), true, true);
 
-  AWAIT_UNTIL(newMasterDetected1);
+  AWAIT_READY(newMasterDetected1);
 
   // Simulate a non-leading master.
   MockMasterDetectorListenerProcess master2;
@@ -482,7 +482,7 @@ TEST_F(ZooKeeperTest, MasterDetectorExpi
   ZooKeeperMasterDetector masterDetector2(
       url.get(), master2.self(), true, true);
 
-  AWAIT_UNTIL(newMasterDetected2);
+  AWAIT_READY(newMasterDetected2);
 
   // Simulate a slave.
   MockMasterDetectorListenerProcess slave;
@@ -501,24 +501,24 @@ TEST_F(ZooKeeperTest, MasterDetectorExpi
   ZooKeeperMasterDetector slaveDetector(
       url.get(), slave.self(), false, true);
 
-  AWAIT_UNTIL(newMasterDetected3);
+  AWAIT_READY(newMasterDetected3);
 
   // Now expire the slave's and leading master's zk sessions.
   // NOTE: Here we assume that slave stays disconnected from the ZK when the
   // leading master loses its session.
   process::Future<int64_t> slaveSession = slaveDetector.session();
-  ASSERT_FUTURE_WILL_SUCCEED(slaveSession);
+  AWAIT_READY(slaveSession);
 
   server->expireSession(slaveSession.get());
 
   process::Future<int64_t> masterSession = masterDetector1.session();
-  ASSERT_FUTURE_WILL_SUCCEED(masterSession);
+  AWAIT_READY(masterSession);
 
   server->expireSession(masterSession.get());
 
   // Wait for session expiration and ensure we receive a
   // NewMasterDetected message.
-  AWAIT_FOR(newMasterDetected4, Seconds(5)); // ZooKeeper needs extra time.
+  AWAIT_READY_FOR(newMasterDetected4, Seconds(5)); // ZooKeeper needs time.
 
   process::terminate(slave);
   process::wait(slave);
@@ -538,26 +538,26 @@ TEST_F(ZooKeeperTest, Group)
   process::Future<zookeeper::Group::Membership> membership =
     group.join("hello world");
 
-  ASSERT_FUTURE_WILL_SUCCEED(membership);
+  AWAIT_READY(membership);
 
   process::Future<std::set<zookeeper::Group::Membership> > memberships =
     group.watch();
 
-  ASSERT_FUTURE_WILL_SUCCEED(memberships);
+  AWAIT_READY(memberships);
   EXPECT_EQ(1u, memberships.get().size());
   EXPECT_EQ(1u, memberships.get().count(membership.get()));
 
   process::Future<std::string> data = group.data(membership.get());
 
-  EXPECT_FUTURE_WILL_EQ("hello world", data);
+  AWAIT_EXPECT_EQ("hello world", data);
 
   process::Future<bool> cancellation = group.cancel(membership.get());
 
-  EXPECT_FUTURE_WILL_EQ(true, cancellation);
+  AWAIT_EXPECT_EQ(true, cancellation);
 
   memberships = group.watch(memberships.get());
 
-  ASSERT_FUTURE_WILL_SUCCEED(memberships);
+  AWAIT_READY(memberships);
   EXPECT_EQ(0u, memberships.get().size());
 
   ASSERT_TRUE(membership.get().cancelled().isReady());
@@ -578,12 +578,12 @@ TEST_F(ZooKeeperTest, GroupJoinWithDisco
 
   server->startNetwork();
 
-  ASSERT_FUTURE_WILL_SUCCEED(membership);
+  AWAIT_READY(membership);
 
   process::Future<std::set<zookeeper::Group::Membership> > memberships =
     group.watch();
 
-  ASSERT_FUTURE_WILL_SUCCEED(memberships);
+  AWAIT_READY(memberships);
   EXPECT_EQ(1u, memberships.get().size());
   EXPECT_EQ(1u, memberships.get().count(membership.get()));
 }
@@ -596,12 +596,12 @@ TEST_F(ZooKeeperTest, GroupDataWithDisco
   process::Future<zookeeper::Group::Membership> membership =
     group.join("hello world");
 
-  ASSERT_FUTURE_WILL_SUCCEED(membership);
+  AWAIT_READY(membership);
 
   process::Future<std::set<zookeeper::Group::Membership> > memberships =
     group.watch();
 
-  ASSERT_FUTURE_WILL_SUCCEED(memberships);
+  AWAIT_READY(memberships);
   EXPECT_EQ(1u, memberships.get().size());
   EXPECT_EQ(1u, memberships.get().count(membership.get()));
 
@@ -613,7 +613,7 @@ TEST_F(ZooKeeperTest, GroupDataWithDisco
 
   server->startNetwork();
 
-  EXPECT_FUTURE_WILL_EQ("hello world", data);
+  AWAIT_EXPECT_EQ("hello world", data);
 }
 
 
@@ -624,18 +624,18 @@ TEST_F(ZooKeeperTest, GroupCancelWithDis
   process::Future<zookeeper::Group::Membership> membership =
     group.join("hello world");
 
-  ASSERT_FUTURE_WILL_SUCCEED(membership);
+  AWAIT_READY(membership);
 
   process::Future<std::set<zookeeper::Group::Membership> > memberships =
     group.watch();
 
-  ASSERT_FUTURE_WILL_SUCCEED(memberships);
+  AWAIT_READY(memberships);
   EXPECT_EQ(1u, memberships.get().size());
   EXPECT_EQ(1u, memberships.get().count(membership.get()));
 
   process::Future<std::string> data = group.data(membership.get());
 
-  EXPECT_FUTURE_WILL_EQ("hello world", data);
+  AWAIT_EXPECT_EQ("hello world", data);
 
   server->shutdownNetwork();
 
@@ -645,11 +645,11 @@ TEST_F(ZooKeeperTest, GroupCancelWithDis
 
   server->startNetwork();
 
-  EXPECT_FUTURE_WILL_EQ(true, cancellation);
+  AWAIT_EXPECT_EQ(true, cancellation);
 
   memberships = group.watch(memberships.get());
 
-  ASSERT_FUTURE_WILL_SUCCEED(memberships);
+  AWAIT_READY(memberships);
   EXPECT_EQ(0u, memberships.get().size());
 
   ASSERT_TRUE(membership.get().cancelled().isReady());
@@ -664,25 +664,25 @@ TEST_F(ZooKeeperTest, GroupWatchWithSess
   process::Future<zookeeper::Group::Membership> membership =
     group.join("hello world");
 
-  ASSERT_FUTURE_WILL_SUCCEED(membership);
+  AWAIT_READY(membership);
 
   process::Future<std::set<zookeeper::Group::Membership> > memberships =
     group.watch();
 
-  ASSERT_FUTURE_WILL_SUCCEED(memberships);
+  AWAIT_READY(memberships);
   EXPECT_EQ(1u, memberships.get().size());
   EXPECT_EQ(1u, memberships.get().count(membership.get()));
 
   process::Future<Option<int64_t> > session = group.session();
 
-  ASSERT_FUTURE_WILL_SUCCEED(session);
+  AWAIT_READY(session);
   ASSERT_SOME(session.get());
 
   memberships = group.watch(memberships.get());
 
   server->expireSession(session.get().get());
 
-  ASSERT_FUTURE_WILL_SUCCEED(memberships);
+  AWAIT_READY_FOR(memberships, Seconds(5)); // ZooKeeper needs time.
   EXPECT_EQ(0u, memberships.get().size());
 
   ASSERT_TRUE(membership.get().cancelled().isReady());
@@ -698,17 +698,17 @@ TEST_F(ZooKeeperTest, MultipleGroups)
   process::Future<zookeeper::Group::Membership> membership1 =
     group1.join("group 1");
 
-  ASSERT_FUTURE_WILL_SUCCEED(membership1);
+  AWAIT_READY(membership1);
 
   process::Future<zookeeper::Group::Membership> membership2 =
     group2.join("group 2");
 
-  ASSERT_FUTURE_WILL_SUCCEED(membership2);
+  AWAIT_READY(membership2);
 
   process::Future<std::set<zookeeper::Group::Membership> > memberships1 =
     group1.watch();
 
-  ASSERT_FUTURE_WILL_SUCCEED(memberships1);
+  AWAIT_READY(memberships1);
   EXPECT_EQ(2u, memberships1.get().size());
   EXPECT_EQ(1u, memberships1.get().count(membership1.get()));
   EXPECT_EQ(1u, memberships1.get().count(membership2.get()));
@@ -716,7 +716,7 @@ TEST_F(ZooKeeperTest, MultipleGroups)
   process::Future<std::set<zookeeper::Group::Membership> > memberships2 =
     group2.watch();
 
-  ASSERT_FUTURE_WILL_SUCCEED(memberships2);
+  AWAIT_READY(memberships2);
   EXPECT_EQ(2u, memberships2.get().size());
   EXPECT_EQ(1u, memberships2.get().count(membership1.get()));
   EXPECT_EQ(1u, memberships2.get().count(membership2.get()));
@@ -733,12 +733,12 @@ TEST_F(ZooKeeperTest, MultipleGroups)
 
   process::Future<Option<int64_t> > session1 = group1.session();
 
-  ASSERT_FUTURE_WILL_SUCCEED(session1);
+  AWAIT_READY(session1);
   ASSERT_SOME(session1.get());
 
   server->expireSession(session1.get().get());
 
-  ASSERT_FUTURE_WILL_EQ(false, cancelled);
+  AWAIT_ASSERT_EQ(false, cancelled);
 }
 
 
@@ -769,19 +769,19 @@ TEST_F(ZooKeeperTest, GroupPathWithRestr
   process::Future<zookeeper::Group::Membership> failedMembership1 =
     failedGroup1.join("fail");
 
-  ASSERT_FUTURE_WILL_FAIL(failedMembership1);
+  AWAIT_FAILED_FOR(failedMembership1, Seconds(5)); // ZooKeeper needs time.
 
   zookeeper::Group failedGroup2(server->connectString(), NO_TIMEOUT,
                                 "/read-only/new", auth);
   process::Future<zookeeper::Group::Membership> failedMembership2 =
     failedGroup2.join("fail");
 
-  ASSERT_FUTURE_WILL_FAIL(failedMembership2);
+  AWAIT_FAILED_FOR(failedMembership2, Seconds(5)); // ZooKeeper needs time.
 
   zookeeper::Group successGroup(server->connectString(), NO_TIMEOUT,
                                 "/read-only/writable/", auth);
   process::Future<zookeeper::Group::Membership> successMembership =
     successGroup.join("succeed");
 
-  ASSERT_FUTURE_WILL_SUCCEED(successMembership);
+  AWAIT_READY_FOR(successMembership, Seconds(5)); // ZooKeeper needs time.
 }



Mime
View raw message