You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gr...@apache.org on 2017/09/13 17:55:35 UTC

[1/4] mesos git commit: Added new overloads for the `createExecutorInfo` test helper method.

Repository: mesos
Updated Branches:
  refs/heads/master 4a3d776a3 -> 2a6f6b7ae


Added new overloads for the `createExecutorInfo` test helper method.

These new overloads make it possible to specify framework ID, executor
resources, and executor ID as a protobuf message rather than a string.

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


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/1f4d7ef2
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/1f4d7ef2
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/1f4d7ef2

Branch: refs/heads/master
Commit: 1f4d7ef27e0e4936c1ea15d4e56d778e35a92507
Parents: 4a3d776
Author: Gastón Kleiman <ga...@mesosphere.io>
Authored: Wed Sep 13 09:21:20 2017 -0700
Committer: Greg Mann <gr...@gmail.com>
Committed: Wed Sep 13 10:49:24 2017 -0700

----------------------------------------------------------------------
 src/tests/mesos.hpp | 170 +++++++++++++++++++++++++++++++++++------------
 1 file changed, 129 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/1f4d7ef2/src/tests/mesos.hpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.hpp b/src/tests/mesos.hpp
index 444c757..b0749db 100644
--- a/src/tests/mesos.hpp
+++ b/src/tests/mesos.hpp
@@ -472,73 +472,157 @@ using DefaultFrameworkInfo =
 // We factor out all common behavior and templatize it so that we can
 // can call it from both `v1::` and `internal::`.
 namespace common {
-template <typename TExecutorInfo, typename TResources, typename TCommandInfo>
+
+template <typename TCommandInfo>
+inline TCommandInfo createCommandInfo(
+    const Option<std::string>& value = None(),
+    const std::vector<std::string>& arguments = {})
+{
+  TCommandInfo commandInfo;
+  if (value.isSome()) {
+    commandInfo.set_value(value.get());
+  }
+  if (!arguments.empty()) {
+    commandInfo.set_shell(false);
+    foreach (const std::string& arg, arguments) {
+      commandInfo.add_arguments(arg);
+    }
+  }
+  return commandInfo;
+}
+
+
+template <typename TExecutorInfo,
+          typename TExecutorID,
+          typename TResources,
+          typename TCommandInfo,
+          typename TFrameworkID>
 inline TExecutorInfo createExecutorInfo(
-    const std::string& executorId,
-    const Option<TCommandInfo>& command = None(),
-    const Option<std::string>& resources = None(),
-    const Option<typename TExecutorInfo::Type>& type = None())
+    const TExecutorID& executorId,
+    const Option<TCommandInfo>& command,
+    const Option<TResources>& resources,
+    const Option<typename TExecutorInfo::Type>& type,
+    const Option<TFrameworkID>& frameworkId)
 {
   TExecutorInfo executor;
-  executor.mutable_executor_id()->set_value(executorId);
+  executor.mutable_executor_id()->CopyFrom(executorId);
   if (command.isSome()) {
     executor.mutable_command()->CopyFrom(command.get());
   }
   if (resources.isSome()) {
-    executor.mutable_resources()->CopyFrom(
-        TResources::parse(resources.get()).get());
+    executor.mutable_resources()->CopyFrom(resources.get());
   }
   if (type.isSome()) {
     executor.set_type(type.get());
   }
+  if (frameworkId.isSome()) {
+    executor.mutable_framework_id()->CopyFrom(frameworkId.get());
+  }
   return executor;
 }
 
 
-template <typename TExecutorInfo, typename TResources, typename TCommandInfo>
+template <typename TExecutorInfo,
+          typename TExecutorID,
+          typename TResources,
+          typename TCommandInfo,
+          typename TFrameworkID>
+inline TExecutorInfo createExecutorInfo(
+    const std::string& _executorId,
+    const Option<TCommandInfo>& command,
+    const Option<TResources>& resources,
+    const Option<typename TExecutorInfo::Type>& type,
+    const Option<TFrameworkID>& frameworkId)
+{
+  TExecutorID executorId;
+  executorId.set_value(_executorId);
+  return createExecutorInfo<TExecutorInfo,
+                            TExecutorID,
+                            TResources,
+                            TCommandInfo,
+                            TFrameworkID>(
+      executorId, command, resources, type, frameworkId);
+}
+
+
+template <typename TExecutorInfo,
+          typename TExecutorID,
+          typename TResources,
+          typename TCommandInfo,
+          typename TFrameworkID>
 inline TExecutorInfo createExecutorInfo(
     const std::string& executorId,
-    const std::string& command,
+    const Option<TCommandInfo>& command = None(),
     const Option<std::string>& resources = None(),
-    const Option<typename TExecutorInfo::Type>& type = None())
+    const Option<typename TExecutorInfo::Type>& type = None(),
+    const Option<TFrameworkID>& frameworkId = None())
 {
-  TCommandInfo commandInfo;
-  commandInfo.set_value(command);
-  return createExecutorInfo<TExecutorInfo, TResources, TCommandInfo>(
-      executorId, commandInfo, resources, type);
+  if (resources.isSome()) {
+    return createExecutorInfo<TExecutorInfo,
+                              TExecutorID,
+                              TResources,
+                              TCommandInfo,
+                              TFrameworkID>(
+        executorId,
+        command,
+        TResources::parse(resources.get()).get(),
+        type,
+        frameworkId);
+  }
+
+  return createExecutorInfo<TExecutorInfo,
+                            TExecutorID,
+                            TResources,
+                            TCommandInfo,
+                            TFrameworkID>(
+      executorId, command, Option<TResources>::none(), type, frameworkId);
 }
 
 
-template <typename TExecutorInfo, typename TResources, typename TCommandInfo>
+template <typename TExecutorInfo,
+          typename TExecutorID,
+          typename TResources,
+          typename TCommandInfo,
+          typename TFrameworkID>
 inline TExecutorInfo createExecutorInfo(
-    const std::string& executorId,
-    const char* command,
-    const Option<std::string>& resources = None(),
-    const Option<typename TExecutorInfo::Type>& type = None())
-{
-  return createExecutorInfo<TExecutorInfo, TResources, TCommandInfo>(
+    const TExecutorID& executorId,
+    const Option<TCommandInfo>& command,
+    const std::string& resources,
+    const Option<typename TExecutorInfo::Type>& type = None(),
+    const Option<TFrameworkID>& frameworkId = None())
+{
+  return createExecutorInfo<TExecutorInfo,
+                            TExecutorID,
+                            TResources,
+                            TCommandInfo,
+                            TFrameworkID>(
       executorId,
-      std::string(command),
-      resources);
+      command,
+      TResources::parse(resources).get(),
+      type,
+      frameworkId);
 }
 
 
-template <typename TCommandInfo>
-inline TCommandInfo createCommandInfo(
-    const Option<std::string>& value = None(),
-    const std::vector<std::string>& arguments = {})
+template <typename TExecutorInfo,
+          typename TExecutorID,
+          typename TResources,
+          typename TCommandInfo,
+          typename TFrameworkID>
+inline TExecutorInfo createExecutorInfo(
+    const std::string& executorId,
+    const std::string& command,
+    const Option<std::string>& resources = None(),
+    const Option<typename TExecutorInfo::Type>& type = None(),
+    const Option<TFrameworkID>& frameworkId = None())
 {
-  TCommandInfo commandInfo;
-  if (value.isSome()) {
-    commandInfo.set_value(value.get());
-  }
-  if (!arguments.empty()) {
-    commandInfo.set_shell(false);
-    foreach (const std::string& arg, arguments) {
-      commandInfo.add_arguments(arg);
-    }
-  }
-  return commandInfo;
+  TCommandInfo commandInfo = createCommandInfo<TCommandInfo>(command);
+  return createExecutorInfo<TExecutorInfo,
+                            TExecutorID,
+                            TResources,
+                            TCommandInfo,
+                            TFrameworkID>(
+      executorId, commandInfo, resources, type, frameworkId);
 }
 
 
@@ -1146,8 +1230,10 @@ inline ExecutorInfo createExecutorInfo(Args&&... args)
 {
   return common::createExecutorInfo<
       ExecutorInfo,
+      ExecutorID,
       Resources,
-      CommandInfo>(std::forward<Args>(args)...);
+      CommandInfo,
+      FrameworkID>(std::forward<Args>(args)...);
 }
 
 
@@ -1439,8 +1525,10 @@ inline mesos::v1::ExecutorInfo createExecutorInfo(Args&&... args)
 {
   return common::createExecutorInfo<
       mesos::v1::ExecutorInfo,
+      mesos::v1::ExecutorID,
       mesos::v1::Resources,
-      mesos::v1::CommandInfo>(std::forward<Args>(args)...);
+      mesos::v1::CommandInfo,
+      mesos::v1::FrameworkID>(std::forward<Args>(args)...);
 }
 
 


[4/4] mesos git commit: Changed `EXPECT` to `ASSERT` when relying on the assertion afterwards.

Posted by gr...@apache.org.
Changed `EXPECT` to `ASSERT` when relying on the assertion afterwards.

A common pattern in our tests is to check that at least one offer is
received using:

'EXPECT_FALSE(offers->offers().empty())'

The test then accesses the first element of the array returned by
`offers->offers()` to extract information such as the agent ID.

This patch makes the tests that follow this pattern use `ASSERT_FALSE`
instead of `EXPECT_FALSE` to avoid invalid memory accesses when the
array is empty.

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


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2a6f6b7a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2a6f6b7a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2a6f6b7a

Branch: refs/heads/master
Commit: 2a6f6b7aedf05b23ae0fe04364159c87f6c5cea8
Parents: e7df335
Author: Gastón Kleiman <ga...@mesosphere.io>
Authored: Wed Sep 13 09:21:25 2017 -0700
Committer: Greg Mann <gr...@gmail.com>
Committed: Wed Sep 13 10:51:16 2017 -0700

----------------------------------------------------------------------
 src/tests/api_tests.cpp                         | 38 +++++-----
 src/tests/check_tests.cpp                       | 34 ++++-----
 src/tests/container_logger_tests.cpp            | 10 +--
 .../containerizer/cgroups_isolator_tests.cpp    | 26 +++----
 src/tests/containerizer/cpu_isolator_tests.cpp  |  4 +-
 .../environment_secret_isolator_tests.cpp       |  2 +-
 .../containerizer/io_switchboard_tests.cpp      |  4 +-
 .../linux_capabilities_isolator_tests.cpp       |  2 +-
 .../linux_filesystem_isolator_tests.cpp         |  2 +-
 .../containerizer/memory_isolator_tests.cpp     |  2 +-
 .../containerizer/memory_pressure_tests.cpp     |  4 +-
 .../containerizer/nvidia_gpu_isolator_tests.cpp |  4 +-
 src/tests/containerizer/port_mapping_tests.cpp  | 10 +--
 .../containerizer/runtime_isolator_tests.cpp    |  6 +-
 src/tests/containerizer/xfs_quota_tests.cpp     | 14 ++--
 src/tests/default_executor_tests.cpp            | 24 +++---
 src/tests/disk_quota_tests.cpp                  | 10 +--
 src/tests/exception_tests.cpp                   |  2 +-
 src/tests/fault_tolerance_tests.cpp             | 16 ++--
 src/tests/gc_tests.cpp                          |  2 +-
 src/tests/health_check_tests.cpp                | 44 +++++------
 src/tests/hook_tests.cpp                        |  6 +-
 src/tests/http_fault_tolerance_tests.cpp        |  8 +-
 src/tests/master_authorization_tests.cpp        | 26 +++----
 src/tests/master_maintenance_tests.cpp          |  2 +-
 src/tests/master_slave_reconciliation_tests.cpp | 12 +--
 src/tests/master_tests.cpp                      |  2 +-
 src/tests/master_validation_tests.cpp           | 38 +++++-----
 src/tests/oversubscription_tests.cpp            | 34 ++++-----
 src/tests/persistent_volume_tests.cpp           | 76 +++++++++----------
 src/tests/reconciliation_tests.cpp              |  2 +-
 src/tests/registrar_zookeeper_tests.cpp         |  2 +-
 src/tests/reservation_endpoints_tests.cpp       |  2 +-
 src/tests/resource_offers_tests.cpp             |  6 +-
 src/tests/scheduler_driver_tests.cpp            |  2 +-
 src/tests/scheduler_tests.cpp                   | 22 +++---
 src/tests/slave_authorization_tests.cpp         | 12 +--
 src/tests/slave_recovery_tests.cpp              | 72 +++++++++---------
 src/tests/slave_tests.cpp                       | 78 ++++++++++----------
 src/tests/status_update_manager_tests.cpp       | 14 ++--
 src/tests/teardown_tests.cpp                    |  2 +-
 41 files changed, 339 insertions(+), 339 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/api_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/api_tests.cpp b/src/tests/api_tests.cpp
index 0902a66..d260a1c 100644
--- a/src/tests/api_tests.cpp
+++ b/src/tests/api_tests.cpp
@@ -371,7 +371,7 @@ TEST_P(MasterAPITest, GetExecutors)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("test");
@@ -458,7 +458,7 @@ TEST_P(MasterAPITest, GetState)
 
   driver.start();
 
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   ContentType contentType = GetParam();
 
@@ -616,7 +616,7 @@ TEST_P(MasterAPITest, GetTasks)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("test");
@@ -2053,7 +2053,7 @@ TEST_P(MasterAPITest, Subscribe)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   // Create event stream after seeing first offer but before first task is
   // launched. We should see one framework, one agent and zero task/executor.
@@ -3045,7 +3045,7 @@ TEST_P(MasterAPITest, CreateAndDestroyVolumes)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   Offer offer = offers.get()[0];
 
   EXPECT_TRUE(Resources(offer.resources()).contains(
@@ -3928,7 +3928,7 @@ TEST_P(AgentAPITest, GetContainers)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 
@@ -4180,7 +4180,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(AgentAPITest, GetFrameworks)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   const Offer& offer = offers.get()[0];
 
   TaskInfo task;
@@ -4283,7 +4283,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(AgentAPITest, GetExecutors)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   const Offer& offer = offers.get()[0];
 
   TaskInfo task;
@@ -4390,7 +4390,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(AgentAPITest, GetTasks)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   const Offer& offer = offers.get()[0];
 
   TaskInfo task;
@@ -4553,7 +4553,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(AgentAPITest, GetState)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   const Offer& offer = offers.get()[0];
 
   TaskInfo task;
@@ -5298,7 +5298,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(AgentAPITest, LaunchNestedContainerSession)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Future<TaskStatus> status;
   EXPECT_CALL(sched, statusUpdate(_, _))
@@ -5419,7 +5419,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Future<TaskStatus> status;
   EXPECT_CALL(sched, statusUpdate(_, _))
@@ -5515,7 +5515,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Future<TaskStatus> status;
   EXPECT_CALL(sched, statusUpdate(_, _))
@@ -5632,7 +5632,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Future<TaskStatus> status;
   EXPECT_CALL(sched, statusUpdate(_, _))
@@ -5743,7 +5743,7 @@ TEST_P(AgentAPITest, AttachContainerOutputFailure)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   EXPECT_CALL(exec, registered(_, _, _, _));
 
@@ -5827,7 +5827,7 @@ TEST_F(AgentAPITest, AttachContainerInputFailure)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   EXPECT_CALL(exec, registered(_, _, _, _));
 
@@ -5936,7 +5936,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Future<TaskStatus> status;
   EXPECT_CALL(sched, statusUpdate(_, _))
@@ -6298,7 +6298,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(AgentAPIStreamingTest,
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 
@@ -6542,7 +6542,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/check_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/check_tests.cpp b/src/tests/check_tests.cpp
index cc7be31..fd15a47 100644
--- a/src/tests/check_tests.cpp
+++ b/src/tests/check_tests.cpp
@@ -284,7 +284,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -433,7 +433,7 @@ TEST_F(CommandExecutorCheckTest, CommandCheckStatusChange)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -553,7 +553,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -656,7 +656,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -777,7 +777,7 @@ TEST_F(CommandExecutorCheckTest, CommandCheckTimeout)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -882,7 +882,7 @@ TEST_F(CommandExecutorCheckTest, CommandCheckAndHealthCheckNoShadowing)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -1034,7 +1034,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(CommandExecutorCheckTest, HTTPCheckDelivered)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -1167,7 +1167,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(CommandExecutorCheckTest, TCPCheckDelivered)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -1377,7 +1377,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -1571,7 +1571,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -1732,7 +1732,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -1877,7 +1877,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -2045,7 +2045,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(DefaultExecutorCheckTest, CommandCheckTimeout)
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -2193,7 +2193,7 @@ TEST_F(DefaultExecutorCheckTest, CommandCheckAndHealthCheckNoShadowing)
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -2366,7 +2366,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -2509,7 +2509,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(DefaultExecutorCheckTest, HTTPCheckDelivered)
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
@@ -2658,7 +2658,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(DefaultExecutorCheckTest, TCPCheckDelivered)
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/container_logger_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/container_logger_tests.cpp b/src/tests/container_logger_tests.cpp
index 97e7979..fb8e441 100644
--- a/src/tests/container_logger_tests.cpp
+++ b/src/tests/container_logger_tests.cpp
@@ -183,7 +183,7 @@ TEST_F(ContainerLoggerTest, DefaultToSandbox)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // We'll start a task that outputs to stdout.
   TaskInfo task = createTask(offers.get()[0], "echo 'Hello World!'");
@@ -284,7 +284,7 @@ TEST_F(ContainerLoggerTest, LOGROTATE_RotateInSandbox)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Start a task that spams stdout with 11 MB of (mostly blank) output.
   // The logrotate container logger module is loaded with parameters that limit
@@ -434,7 +434,7 @@ TEST_F(ContainerLoggerTest, LOGROTATE_CustomRotateOptions)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const string customConfig = "some-custom-logrotate-option";
 
@@ -540,7 +540,7 @@ TEST_F(ContainerLoggerTest, LOGROTATE_ModuleFDOwnership)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Start a task that will keep running until the end of the test.
   TaskInfo task = createTask(offers.get()[0], "sleep 100");
@@ -665,7 +665,7 @@ TEST_P(UserContainerLoggerTest, ROOT_LOGROTATE_RotateWithSwitchUserTrueOrFalse)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Start a task that spams stdout with 3 MB of (mostly blank) output.
   // The logrotate container logger module is loaded with parameters that limit

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/containerizer/cgroups_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/cgroups_isolator_tests.cpp b/src/tests/containerizer/cgroups_isolator_tests.cpp
index 68b8181..3fc9341 100644
--- a/src/tests/containerizer/cgroups_isolator_tests.cpp
+++ b/src/tests/containerizer/cgroups_isolator_tests.cpp
@@ -156,7 +156,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_PERF_NET_CLS_UserCgroup)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task with the command executor.
   CommandInfo command;
@@ -295,7 +295,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_RevocableCpu)
 
   // Initially the framework will get all regular resources.
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
   EXPECT_TRUE(Resources(offers1.get()[0].resources()).revocable().empty());
 
   Future<vector<Offer>> offers2;
@@ -311,7 +311,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_RevocableCpu)
 
   // Now the framework will get revocable resources.
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
   EXPECT_EQ(allocatedResources(cpus, frameworkInfo.role()),
             Resources(offers2.get()[0].resources()));
 
@@ -396,7 +396,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_CFS_EnableCfs)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Generate random numbers to max out a single core. We'll run this
   // for 0.5 seconds of wall time so it should consume approximately
@@ -518,7 +518,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_LimitSwap)
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
 
@@ -605,7 +605,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_PidsAndTids)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   CommandInfo command;
   command.set_shell(false);
@@ -1013,7 +1013,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_PERF_Sample)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 120");
 
@@ -1129,7 +1129,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_PERF_PerfForward)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   Future<TaskStatus> statusRunning1;
   EXPECT_CALL(sched, statusUpdate(&driver, _))
@@ -1192,7 +1192,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_PERF_PerfForward)
   AWAIT_READY(__recover);
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
 
   // The first container should not report any perf statistics.
   usage = containerizer->usage(containerId1);
@@ -1290,7 +1290,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_MemoryForward)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   Future<TaskStatus> statusRunning1;
   EXPECT_CALL(sched, statusUpdate(&driver, _))
@@ -1350,7 +1350,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_MemoryForward)
   AWAIT_READY(__recover);
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
 
   // The first container should not report memory statistics.
   usage = containerizer->usage(containerId1);
@@ -1446,7 +1446,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_MemoryBackward)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   Future<TaskStatus> statusRunning1;
   EXPECT_CALL(sched, statusUpdate(&driver, _))
@@ -1505,7 +1505,7 @@ TEST_F(CgroupsIsolatorTest, ROOT_CGROUPS_MemoryBackward)
   AWAIT_READY(__recover);
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
 
   // The first container should not report memory statistics.
   usage = containerizer->usage(containerId1);

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/containerizer/cpu_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/cpu_isolator_tests.cpp b/src/tests/containerizer/cpu_isolator_tests.cpp
index f7cab58..153990d 100644
--- a/src/tests/containerizer/cpu_isolator_tests.cpp
+++ b/src/tests/containerizer/cpu_isolator_tests.cpp
@@ -106,7 +106,7 @@ TEST_P(CpuIsolatorTest, ROOT_UserCpuUsage)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Max out a single core in userspace. This will run for at most one
   // second.
@@ -197,7 +197,7 @@ TEST_P(CpuIsolatorTest, ROOT_SystemCpuUsage)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Generating random numbers is done by the kernel and will max out
   // a single core and run almost exclusively in the kernel, i.e.,

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/containerizer/environment_secret_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/environment_secret_isolator_tests.cpp b/src/tests/containerizer/environment_secret_isolator_tests.cpp
index 38fef2d..cf7b9eb 100644
--- a/src/tests/containerizer/environment_secret_isolator_tests.cpp
+++ b/src/tests/containerizer/environment_secret_isolator_tests.cpp
@@ -81,7 +81,7 @@ TEST_F(EnvironmentSecretIsolatorTest, ResolveSecret)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const string commandString = strings::format(
       "env; test \"$%s\" = \"%s\"",

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/containerizer/io_switchboard_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/io_switchboard_tests.cpp b/src/tests/containerizer/io_switchboard_tests.cpp
index de42be9..bf7917a 100644
--- a/src/tests/containerizer/io_switchboard_tests.cpp
+++ b/src/tests/containerizer/io_switchboard_tests.cpp
@@ -965,7 +965,7 @@ TEST_F(IOSwitchboardTest, DISABLED_RecoverThenKillSwitchboardContainerDestroyed)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task with tty to start the switchboard server.
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
@@ -1085,7 +1085,7 @@ TEST_F(IOSwitchboardTest, ContainerAttachAfterSlaveRestart)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Future<TaskStatus> statusRunning;
   EXPECT_CALL(sched, statusUpdate(_, _))

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/containerizer/linux_capabilities_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/linux_capabilities_isolator_tests.cpp b/src/tests/containerizer/linux_capabilities_isolator_tests.cpp
index a1ff9b5..d3c4568 100644
--- a/src/tests/containerizer/linux_capabilities_isolator_tests.cpp
+++ b/src/tests/containerizer/linux_capabilities_isolator_tests.cpp
@@ -255,7 +255,7 @@ TEST_P(LinuxCapabilitiesIsolatorTest, ROOT_Ping)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // We use 'ping' as the command since it has file capabilities
   // (`NET_RAW` and `NET_ADMIN` in permitted set). This allows us to

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/containerizer/linux_filesystem_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/linux_filesystem_isolator_tests.cpp b/src/tests/containerizer/linux_filesystem_isolator_tests.cpp
index 76cc007..a657a6f 100644
--- a/src/tests/containerizer/linux_filesystem_isolator_tests.cpp
+++ b/src/tests/containerizer/linux_filesystem_isolator_tests.cpp
@@ -907,7 +907,7 @@ TEST_F(LinuxFilesystemIsolatorMesosTest,
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/containerizer/memory_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/memory_isolator_tests.cpp b/src/tests/containerizer/memory_isolator_tests.cpp
index a7028da..14bd705 100644
--- a/src/tests/containerizer/memory_isolator_tests.cpp
+++ b/src/tests/containerizer/memory_isolator_tests.cpp
@@ -106,7 +106,7 @@ TEST_P(MemoryIsolatorTest, ROOT_MemUsage)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 120");
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/containerizer/memory_pressure_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/memory_pressure_tests.cpp b/src/tests/containerizer/memory_pressure_tests.cpp
index eec2e05..c4d8bfc 100644
--- a/src/tests/containerizer/memory_pressure_tests.cpp
+++ b/src/tests/containerizer/memory_pressure_tests.cpp
@@ -113,7 +113,7 @@ TEST_F(MemoryPressureMesosTest, CGROUPS_ROOT_Statistics)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -234,7 +234,7 @@ TEST_F(MemoryPressureMesosTest, CGROUPS_ROOT_SlaveRecovery)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/containerizer/nvidia_gpu_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/nvidia_gpu_isolator_tests.cpp b/src/tests/containerizer/nvidia_gpu_isolator_tests.cpp
index f7a7158..b97b9a4 100644
--- a/src/tests/containerizer/nvidia_gpu_isolator_tests.cpp
+++ b/src/tests/containerizer/nvidia_gpu_isolator_tests.cpp
@@ -335,7 +335,7 @@ TEST_F(NvidiaGpuTest, ROOT_CGROUPS_NVIDIA_GPU_FractionalResources)
   // Launch a task requesting a fractional number
   // of GPUs and verify that it fails as expected.
   AWAIT_READY(offers);
-  EXPECT_EQ(1u, offers->size());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(
       offers.get()[0].slave_id(),
@@ -707,7 +707,7 @@ TEST_F(NvidiaGpuTest, ROOT_CGROUPS_NVIDIA_GPU_DefaultExecutorVerifyDeviceAccess)
   executorInfo.mutable_resources()->CopyFrom(resources);
 
   AWAIT_READY(offers);
-  EXPECT_NE(0u, offers->size());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers->front();
   const SlaveID& slaveId = offer.slave_id();

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/containerizer/port_mapping_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/port_mapping_tests.cpp b/src/tests/containerizer/port_mapping_tests.cpp
index 544eaef..e9d90e7 100644
--- a/src/tests/containerizer/port_mapping_tests.cpp
+++ b/src/tests/containerizer/port_mapping_tests.cpp
@@ -1915,7 +1915,7 @@ TEST_F(PortMappingMesosTest, CGROUPS_ROOT_RecoverMixedContainers)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   Offer offer1 = offers1.get()[0];
 
@@ -1972,7 +1972,7 @@ TEST_F(PortMappingMesosTest, CGROUPS_ROOT_RecoverMixedContainers)
   Clock::resume();
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
 
   Offer offer2 = offers2.get()[0];
 
@@ -2084,7 +2084,7 @@ TEST_F(PortMappingMesosTest, CGROUPS_ROOT_CleanUpOrphan)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Start a long running task using network islator.
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
@@ -2205,7 +2205,7 @@ TEST_F(PortMappingMesosTest, ROOT_NetworkNamespaceHandleSymlink)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Start a long running task using network islator.
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
@@ -2298,7 +2298,7 @@ TEST_F(PortMappingMesosTest, CGROUPS_ROOT_RecoverMixedKnownAndUnKnownOrphans)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/containerizer/runtime_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/runtime_isolator_tests.cpp b/src/tests/containerizer/runtime_isolator_tests.cpp
index 8bf6a11..ea5d035 100644
--- a/src/tests/containerizer/runtime_isolator_tests.cpp
+++ b/src/tests/containerizer/runtime_isolator_tests.cpp
@@ -386,7 +386,7 @@ TEST_F(DockerRuntimeIsolatorTest, ROOT_INTERNET_CURL_NestedSimpleCommand)
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
 
@@ -505,7 +505,7 @@ TEST_F(DockerRuntimeIsolatorTest, ROOT_NestedDockerDefaultCmdLocalPuller)
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
 
@@ -625,7 +625,7 @@ TEST_F(DockerRuntimeIsolatorTest, ROOT_NestedDockerDefaultEntryptLocalPuller)
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/containerizer/xfs_quota_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/xfs_quota_tests.cpp b/src/tests/containerizer/xfs_quota_tests.cpp
index 11dc7f5..4603847 100644
--- a/src/tests/containerizer/xfs_quota_tests.cpp
+++ b/src/tests/containerizer/xfs_quota_tests.cpp
@@ -403,7 +403,7 @@ TEST_F(ROOT_XFS_QuotaTest, DiskUsageExceedsQuota)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 
@@ -469,7 +469,7 @@ TEST_F(ROOT_XFS_QuotaTest, DiskUsageExceedsQuotaNoEnforce)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 
@@ -540,7 +540,7 @@ TEST_F(ROOT_XFS_QuotaTest, ResourceStatistics)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -637,7 +637,7 @@ TEST_F(ROOT_XFS_QuotaTest, ResourceStatisticsNoEnforce)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -740,7 +740,7 @@ TEST_F(ROOT_XFS_QuotaTest, NoCheckpointRecovery)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -864,7 +864,7 @@ TEST_F(ROOT_XFS_QuotaTest, CheckpointRecovery)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -977,7 +977,7 @@ TEST_F(ROOT_XFS_QuotaTest, RecoverOldContainers)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/default_executor_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/default_executor_tests.cpp b/src/tests/default_executor_tests.cpp
index 0815fb8..dd1a6ad 100644
--- a/src/tests/default_executor_tests.cpp
+++ b/src/tests/default_executor_tests.cpp
@@ -170,7 +170,7 @@ TEST_P(DefaultExecutorTest, TaskRunning)
       frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
@@ -276,7 +276,7 @@ TEST_P(DefaultExecutorTest, KillTask)
       frameworkId);
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->offers().empty());
+  ASSERT_FALSE(offers1->offers().empty());
 
   const v1::Offer& offer1 = offers1->offers(0);
   const v1::AgentID& agentId = offer1.agent_id();
@@ -480,7 +480,7 @@ TEST_P(DefaultExecutorTest, KillTaskGroupOnTaskFailure)
       frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
@@ -633,7 +633,7 @@ TEST_P(DefaultExecutorTest, TaskUsesExecutor)
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
@@ -713,7 +713,7 @@ TEST_P(DefaultExecutorTest, ROOT_ContainerStatusForTask)
       frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
@@ -813,7 +813,7 @@ TEST_P(DefaultExecutorTest, CommitSuicideOnTaskFailure)
       frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
@@ -907,7 +907,7 @@ TEST_P(DefaultExecutorTest, CommitSuicideOnKillTask)
       frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
@@ -1042,7 +1042,7 @@ TEST_P(DefaultExecutorTest, ReservedResources)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
@@ -1247,7 +1247,7 @@ TEST_P(DefaultExecutorTest, ROOT_MultiTaskgroupSharePidNamespace)
       frameworkId);
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->offers().empty());
+  ASSERT_FALSE(offers1->offers().empty());
 
   const v1::Offer& offer1 = offers1->offers(0);
   const v1::AgentID& agentId = offer1.agent_id();
@@ -1285,7 +1285,7 @@ TEST_P(DefaultExecutorTest, ROOT_MultiTaskgroupSharePidNamespace)
   EXPECT_TRUE(update1->status().has_timestamp());
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->offers().empty());
+  ASSERT_FALSE(offers2->offers().empty());
 
   const v1::Offer& offer2 = offers2->offers(0);
 
@@ -1480,7 +1480,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
       frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
 
@@ -1602,7 +1602,7 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
       frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/disk_quota_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/disk_quota_tests.cpp b/src/tests/disk_quota_tests.cpp
index 3bf0508..742b6e1 100644
--- a/src/tests/disk_quota_tests.cpp
+++ b/src/tests/disk_quota_tests.cpp
@@ -208,7 +208,7 @@ TEST_F(DiskQuotaTest, DiskUsageExceedsQuota)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 
@@ -287,7 +287,7 @@ TEST_F(DiskQuotaTest, VolumeUsageExceedsQuota)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 
@@ -385,7 +385,7 @@ TEST_F(DiskQuotaTest, NoQuotaEnforcement)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 
@@ -492,7 +492,7 @@ TEST_F(DiskQuotaTest, ResourceStatistics)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 
@@ -644,7 +644,7 @@ TEST_F(DiskQuotaTest, SlaveRecovery)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/exception_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/exception_tests.cpp b/src/tests/exception_tests.cpp
index 0e72cdf..170e375 100644
--- a/src/tests/exception_tests.cpp
+++ b/src/tests/exception_tests.cpp
@@ -161,7 +161,7 @@ TEST_F(ExceptionTest, DisallowSchedulerCallbacksOnAbort)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // None of these callbacks should be invoked.
   EXPECT_CALL(sched, offerRescinded(&driver, _))

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/fault_tolerance_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/fault_tolerance_tests.cpp b/src/tests/fault_tolerance_tests.cpp
index 5ac38a8..c34850a 100644
--- a/src/tests/fault_tolerance_tests.cpp
+++ b/src/tests/fault_tolerance_tests.cpp
@@ -221,7 +221,7 @@ TEST_F(FaultToleranceTest, ReregisterCompletedFrameworks)
   AWAIT_READY(frameworkId);
   EXPECT_NE("", frameworkId->value());
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Step 3. Create/launch a task.
   TaskInfo task =
@@ -951,7 +951,7 @@ TEST_F(FaultToleranceTest, DisconnectedSchedulerLaunchLost)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   AWAIT_READY(message);
 
@@ -1014,7 +1014,7 @@ TEST_F(FaultToleranceTest, DisconnectedSchedulerLaunchDropped)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   AWAIT_READY(message);
 
@@ -1076,7 +1076,7 @@ TEST_F(FaultToleranceTest, SchedulerFailoverStatusUpdate)
   driver1.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task.
   TaskInfo task;
@@ -1286,7 +1286,7 @@ TEST_F(FaultToleranceTest, ForwardStatusUpdateUnknownExecutor)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   Offer offer = offers.get()[0];
 
   TaskInfo task;
@@ -1375,7 +1375,7 @@ TEST_F(FaultToleranceTest, SchedulerFailoverExecutorToFrameworkMessage)
   driver1.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("");
@@ -1475,7 +1475,7 @@ TEST_F(FaultToleranceTest, SchedulerFailoverFrameworkToExecutorMessage)
   driver1.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Future<TaskStatus> status;
   EXPECT_CALL(sched1, statusUpdate(&driver1, _))
@@ -1702,7 +1702,7 @@ TEST_F(FaultToleranceTest, SchedulerExit)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   AWAIT_READY(offers);
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/gc_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/gc_tests.cpp b/src/tests/gc_tests.cpp
index da9a31c..5581861 100644
--- a/src/tests/gc_tests.cpp
+++ b/src/tests/gc_tests.cpp
@@ -932,7 +932,7 @@ TEST_F(GarbageCollectorIntegrationTest, ROOT_BusyMountPoint)
 
   AWAIT_READY(frameworkId);
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
   const SlaveID& slaveId = offer.slave_id();

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/health_check_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/health_check_tests.cpp b/src/tests/health_check_tests.cpp
index 2c43241..f4b50b1 100644
--- a/src/tests/health_check_tests.cpp
+++ b/src/tests/health_check_tests.cpp
@@ -325,7 +325,7 @@ TEST_F(HealthCheckTest, HealthyTask)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   vector<TaskInfo> tasks =
     populateTasks(SLEEP_COMMAND(120), "exit 0", offers.get()[0]);
@@ -468,7 +468,7 @@ TEST_F(HealthCheckTest, ROOT_HealthyTaskWithContainerImage)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Make use of 'populateTasks()' to avoid duplicate code.
   vector<TaskInfo> tasks =
@@ -603,7 +603,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(HealthCheckTest, ROOT_DOCKER_DockerHealthyTask)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   ContainerInfo containerInfo;
   containerInfo.set_type(ContainerInfo::DOCKER);
@@ -698,7 +698,7 @@ TEST_F(HealthCheckTest, HealthyTaskNonShell)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   CommandInfo command;
   command.set_shell(false);
@@ -764,7 +764,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(HealthCheckTest, HealthStatusChange)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Create a temporary file.
   Try<string> temporaryPath = os::mktemp(path::join(os::getcwd(), "XXXXXX"));
@@ -876,7 +876,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   ContainerInfo containerInfo;
   containerInfo.set_type(ContainerInfo::DOCKER);
@@ -1012,7 +1012,7 @@ TEST_F(HealthCheckTest, ConsecutiveFailures)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   vector<TaskInfo> tasks = populateTasks(
     SLEEP_COMMAND(120), "exit 1", offers.get()[0], 0, 4);
@@ -1101,7 +1101,7 @@ TEST_F(HealthCheckTest, EnvironmentSetup)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   map<string, string> env;
   env["STATUS"] = "0";
@@ -1157,7 +1157,7 @@ TEST_F(HealthCheckTest, GracePeriod)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
 #ifndef __WINDOWS__
   const string falseCommand = "false";
@@ -1219,7 +1219,7 @@ TEST_F(HealthCheckTest, CheckCommandTimeout)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   vector<TaskInfo> tasks = populateTasks(
       SLEEP_COMMAND(120),
@@ -1291,7 +1291,7 @@ TEST_F(HealthCheckTest, HealthyToUnhealthyTransitionWithinGracePeriod)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Create a temporary file.
   const string tmpPath = path::join(os::getcwd(), "healthyToUnhealthy");
@@ -1369,7 +1369,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(HealthCheckTest, HealthyTaskViaHTTP)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const uint16_t testPort = getFreePort().get();
 
@@ -1458,7 +1458,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(HealthCheckTest, HealthyTaskViaHTTPWithoutType)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const uint16_t testPort = getFreePort().get();
 
@@ -1538,7 +1538,7 @@ TEST_F(HealthCheckTest, HealthyTaskViaTCP)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const uint16_t testPort = getFreePort().get();
 
@@ -1621,7 +1621,7 @@ TEST_F(HealthCheckTest, ROOT_INTERNET_CURL_HealthyTaskViaHTTPWithContainerImage)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const uint16_t testPort = getFreePort().get();
 
@@ -1709,7 +1709,7 @@ TEST_F(HealthCheckTest,
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const uint16_t testPort = getFreePort().get();
 
@@ -1804,7 +1804,7 @@ TEST_F(HealthCheckTest, ROOT_INTERNET_CURL_HealthyTaskViaTCPWithContainerImage)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const uint16_t testPort = getFreePort().get();
 
@@ -1904,7 +1904,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const uint16_t testPort = getFreePort().get();
 
@@ -2035,7 +2035,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const uint16_t testPort = getFreePort().get();
 
@@ -2171,7 +2171,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const uint16_t testPort = getFreePort().get();
 
@@ -2315,7 +2315,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Future<TaskStatus> statusRunning;
   Future<TaskStatus> statusHealthy;
@@ -2444,7 +2444,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_NE(0u, offers.get().size());
+  ASSERT_FALSE(offers->empty());
 
   Future<TaskStatus> statusRunning;
   Future<TaskStatus> statusHealthy;

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/hook_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/hook_tests.cpp b/src/tests/hook_tests.cpp
index c5acbd0..c4fadbb 100644
--- a/src/tests/hook_tests.cpp
+++ b/src/tests/hook_tests.cpp
@@ -176,7 +176,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(HookTest, VerifyMasterLaunchTaskHook)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("");
@@ -373,7 +373,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(HookTest, VerifySlaveLaunchExecutorHook)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task with the command executor.
   TaskInfo task;
@@ -1103,7 +1103,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Resources resources = offers.get()[0].resources();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/http_fault_tolerance_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/http_fault_tolerance_tests.cpp b/src/tests/http_fault_tolerance_tests.cpp
index f05aee8..d3db8a6 100644
--- a/src/tests/http_fault_tolerance_tests.cpp
+++ b/src/tests/http_fault_tolerance_tests.cpp
@@ -386,7 +386,7 @@ TEST_F(HttpFaultToleranceTest, SchedulerFailoverStatusUpdate)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   EXPECT_CALL(*executor, connected(_))
     .WillOnce(v1::executor::SendSubscribe(frameworkId, evolve(executorId)));
@@ -567,7 +567,7 @@ TEST_F(HttpFaultToleranceTest, SchedulerFailoverExecutorToFrameworkMessage)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   EXPECT_CALL(*executor, connected(_))
     .WillOnce(v1::executor::SendSubscribe(frameworkId, evolve(executorId)));
@@ -739,7 +739,7 @@ TEST_F(HttpFaultToleranceTest, SchedulerFailoverFrameworkToExecutorMessage)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   EXPECT_CALL(*executor, connected(_))
     .WillOnce(v1::executor::SendSubscribe(frameworkId, evolve(executorId)));
@@ -908,7 +908,7 @@ TEST_F(HttpFaultToleranceTest, SchedulerExit)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   EXPECT_CALL(*executor, connected(_))
     .WillOnce(v1::executor::SendSubscribe(frameworkId, evolve(executorId)));

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/master_authorization_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_authorization_tests.cpp b/src/tests/master_authorization_tests.cpp
index a776a58..d8593d8 100644
--- a/src/tests/master_authorization_tests.cpp
+++ b/src/tests/master_authorization_tests.cpp
@@ -135,7 +135,7 @@ TEST_F(MasterAuthorizationTest, AuthorizedTask)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Create an authorized task.
   TaskInfo task;
@@ -207,7 +207,7 @@ TEST_F(MasterAuthorizationTest, UnauthorizedTask)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Create an unauthorized task.
   TaskInfo task;
@@ -281,7 +281,7 @@ TEST_F(MasterAuthorizationTest, UnauthorizedTaskGroup)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Resources resources =
     Resources::parse("cpus:0.1;mem:32;disk:32").get();
@@ -382,7 +382,7 @@ TEST_F(MasterAuthorizationTest, KillTask)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "", DEFAULT_EXECUTOR_ID);
 
@@ -466,7 +466,7 @@ TEST_F(MasterAuthorizationTest, KillPendingTaskInTaskGroup)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Resources resources =
     Resources::parse("cpus:0.1;mem:32;disk:32").get();
@@ -600,7 +600,7 @@ TEST_F(MasterAuthorizationTest, SlaveRemovedLost)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "", DEFAULT_EXECUTOR_ID);
 
@@ -705,7 +705,7 @@ TEST_F(MasterAuthorizationTest, SlaveRemovedDropped)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "", DEFAULT_EXECUTOR_ID);
 
@@ -806,7 +806,7 @@ TEST_F(MasterAuthorizationTest, FrameworkRemoved)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "", DEFAULT_EXECUTOR_ID);
 
@@ -878,7 +878,7 @@ TEST_F(MasterAuthorizationTest, PendingExecutorInfoDiffersOnDifferentSlaves)
   ASSERT_SOME(slave1);
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   // Launch the first task with the default executor id.
   ExecutorInfo executor1;
@@ -920,7 +920,7 @@ TEST_F(MasterAuthorizationTest, PendingExecutorInfoDiffersOnDifferentSlaves)
   ASSERT_SOME(slave2);
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
 
   // Now launch the second task with the same executor id but
   // a different executor command.
@@ -1539,7 +1539,7 @@ TYPED_TEST(MasterAuthorizerTest, FilterStateEndpoint)
   AWAIT_READY(registered);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("test");
@@ -1728,7 +1728,7 @@ TYPED_TEST(MasterAuthorizerTest, FilterFrameworksEndpoint)
   AWAIT_READY(registered);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("test");
@@ -1919,7 +1919,7 @@ TYPED_TEST(MasterAuthorizerTest, FilterTasksEndpoint)
   AWAIT_READY(registered);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("test");

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/master_maintenance_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_maintenance_tests.cpp b/src/tests/master_maintenance_tests.cpp
index 7595e8b..2a06258 100644
--- a/src/tests/master_maintenance_tests.cpp
+++ b/src/tests/master_maintenance_tests.cpp
@@ -1223,7 +1223,7 @@ TEST_F(MasterMaintenanceTest, InverseOffers)
 
   // Ensure we receive some regular resource offers.
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   // All the offers should have unavailability.
   foreach (const v1::Offer& offer, offers->offers()) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/master_slave_reconciliation_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_slave_reconciliation_tests.cpp b/src/tests/master_slave_reconciliation_tests.cpp
index 0b26953..d5eb7ba 100644
--- a/src/tests/master_slave_reconciliation_tests.cpp
+++ b/src/tests/master_slave_reconciliation_tests.cpp
@@ -194,7 +194,7 @@ TEST_F(MasterSlaveReconciliationTest, ReconcileLostTask)
 
   AWAIT_READY(offers);
 
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("test task");
@@ -289,7 +289,7 @@ TEST_F(MasterSlaveReconciliationTest, ReconcileDroppedTask)
 
   AWAIT_READY(offers);
 
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("test task");
@@ -411,7 +411,7 @@ TEST_F(MasterSlaveReconciliationTest, ReconcileRace)
   AWAIT_READY(reregisterSlaveMessage);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("test task");
@@ -511,7 +511,7 @@ TEST_F(MasterSlaveReconciliationTest, SlaveReregisterPendingTask)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // No TASK_LOST updates should occur!
   EXPECT_CALL(sched, statusUpdate(&driver, _))
@@ -580,7 +580,7 @@ TEST_F(MasterSlaveReconciliationTest, SlaveReregisterTerminalTask)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("test task");
@@ -668,7 +668,7 @@ TEST_F(MasterSlaveReconciliationTest, SlaveReregisterFrameworks)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("test task");

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/master_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_tests.cpp b/src/tests/master_tests.cpp
index 59fbad4..98908c0 100644
--- a/src/tests/master_tests.cpp
+++ b/src/tests/master_tests.cpp
@@ -8255,7 +8255,7 @@ TEST_P(MasterTestPrePostReservationRefinement, LaunchGroup)
       evolve<v1::Resource>(outboundResources(resources)));
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/master_validation_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_validation_tests.cpp b/src/tests/master_validation_tests.cpp
index 710b25c..f00dd9b 100644
--- a/src/tests/master_validation_tests.cpp
+++ b/src/tests/master_validation_tests.cpp
@@ -916,7 +916,7 @@ TEST_F(CreateOperationValidationTest, InsufficientDiskResource)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   Offer offer1 = offers1.get()[0];
 
@@ -946,7 +946,7 @@ TEST_F(CreateOperationValidationTest, InsufficientDiskResource)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
 
   Offer offer2 = offers2.get()[0];
 
@@ -1352,7 +1352,7 @@ TEST_F(TaskValidationTest, TaskUsesCommandInfoAndExecutorInfo)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Future<TaskStatus> status;
   EXPECT_CALL(sched, statusUpdate(&driver, _))
@@ -1481,7 +1481,7 @@ TEST_F(TaskValidationTest, TaskUsesNoResources)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("");
@@ -1530,7 +1530,7 @@ TEST_F(TaskValidationTest, TaskUsesMoreResourcesThanOffered)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("");
@@ -1591,7 +1591,7 @@ TEST_F(TaskValidationTest, DuplicatedTaskID)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   ExecutorInfo executor;
   executor.mutable_executor_id()->set_value("default");
@@ -1675,7 +1675,7 @@ TEST_F(TaskValidationTest, ExecutorInfoDiffersOnSameSlave)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   ExecutorInfo executor;
   executor.mutable_executor_id()->set_value("default");
@@ -1769,7 +1769,7 @@ TEST_F(TaskValidationTest, ExecutorInfoDiffersOnDifferentSlaves)
   ASSERT_SOME(slave1);
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   // Launch the first task with the default executor id.
   ExecutorInfo executor1;
@@ -1807,7 +1807,7 @@ TEST_F(TaskValidationTest, ExecutorInfoDiffersOnDifferentSlaves)
   ASSERT_SOME(slave2);
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
 
   // Now launch the second task with the same executor id but
   // a different executor command.
@@ -2159,7 +2159,7 @@ TEST_F(TaskValidationTest, ExecutorShutdownGracePeriodIsNonNegative)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   Offer offer = offers.get()[0];
 
   ExecutorInfo executorInfo(DEFAULT_EXECUTOR_INFO);
@@ -2217,7 +2217,7 @@ TEST_F(TaskValidationTest, KillPolicyGracePeriodIsNonNegative)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   Offer offer = offers.get()[0];
 
   TaskInfo task;
@@ -2275,7 +2275,7 @@ TEST_F(TaskValidationTest, TaskEnvironmentInvalid)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Future<TaskStatus> status;
   EXPECT_CALL(sched, statusUpdate(&driver, _))
@@ -2706,7 +2706,7 @@ TEST_F(TaskGroupValidationTest, ExecutorUsesDockerContainerInfo)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -2805,7 +2805,7 @@ TEST_F(TaskGroupValidationTest, ExecutorWithoutFrameworkId)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Create an invalid executor without framework id.
   ExecutorInfo executor;
@@ -2894,7 +2894,7 @@ TEST_F(TaskGroupValidationTest, TaskUsesDockerContainerInfo)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -2983,7 +2983,7 @@ TEST_F(TaskGroupValidationTest, TaskUsesNetworkInfo)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   Offer offer = offers.get()[0];
 
   Resources resources = Resources::parse("cpus:1;mem:512;disk:32").get();
@@ -3074,7 +3074,7 @@ TEST_F(TaskGroupValidationTest, TaskUsesDifferentExecutor)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   Offer offer = offers.get()[0];
 
   Resources resources = Resources::parse("cpus:1;mem:512;disk:32").get();
@@ -3169,7 +3169,7 @@ TEST_F(TaskGroupValidationTest, ExecutorEnvironmentInvalid)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task1;
   task1.set_name("1");
@@ -3273,7 +3273,7 @@ TEST_F(TaskGroupValidationTest, TaskEnvironmentInvalid)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task1;
   task1.set_name("1");

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/oversubscription_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/oversubscription_tests.cpp b/src/tests/oversubscription_tests.cpp
index a4c4a60..02b10d6 100644
--- a/src/tests/oversubscription_tests.cpp
+++ b/src/tests/oversubscription_tests.cpp
@@ -226,7 +226,7 @@ TEST_F(OversubscriptionTest, FetchResourceUsage)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 10", DEFAULT_EXECUTOR_ID);
   task.mutable_labels()->add_labels()->CopyFrom(
@@ -391,7 +391,7 @@ TEST_F(OversubscriptionTest, RevocableOffer)
 
   // Initially the framework will get all regular resources.
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
   EXPECT_TRUE(Resources(offers1.get()[0].resources()).revocable().empty());
 
   Future<vector<Offer>> offers2;
@@ -410,7 +410,7 @@ TEST_F(OversubscriptionTest, RevocableOffer)
 
   // Now the framework will get revocable resources.
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
   EXPECT_EQ(
       taskResources + executorResources,
       Resources(offers2.get()[0].resources()));
@@ -499,7 +499,7 @@ TEST_F(OversubscriptionTest, RescindRevocableOfferWithIncreasedRevocable)
   Clock::advance(masterFlags.allocation_interval);
   Clock::settle();
 
-  EXPECT_EQ(1u, offers.size());
+  ASSERT_EQ(1u, offers.size());
   EXPECT_TRUE(Resources(offers.get()->resources()).revocable().empty());
 
   // Inject an estimation of oversubscribable resources.
@@ -612,7 +612,7 @@ TEST_F(OversubscriptionTest, RescindRevocableOfferWithDecreasedRevocable)
   Clock::advance(agentFlags.registration_backoff_factor);
   Clock::advance(masterFlags.allocation_interval);
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
   EXPECT_TRUE(Resources(offers1.get()[0].resources()).revocable().empty());
 
   Future<vector<Offer>> offers2;
@@ -625,7 +625,7 @@ TEST_F(OversubscriptionTest, RescindRevocableOfferWithDecreasedRevocable)
 
   // Now the framework will get revocable resources.
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
   EXPECT_EQ(allocatedResources(resources1, framework.role()),
             Resources(offers2.get()[0].resources()));
 
@@ -656,7 +656,7 @@ TEST_F(OversubscriptionTest, RescindRevocableOfferWithDecreasedRevocable)
 
   // The new offer should include the latest oversubscribed resources.
   AWAIT_READY(offers3);
-  EXPECT_FALSE(offers3->empty());
+  ASSERT_FALSE(offers3->empty());
   EXPECT_EQ(allocatedResources(resources2, framework.role()),
             Resources(offers3.get()[0].resources()));
 
@@ -729,7 +729,7 @@ TEST_F(OversubscriptionTest, FixedResourceEstimator)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   const Offer offer = offers.get()[0];
 
   // The offer should contain revocable resources.
@@ -815,7 +815,7 @@ TEST_F(OversubscriptionTest, QoSFetchResourceUsage)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 10", DEFAULT_EXECUTOR_ID);
   task.mutable_executor()->mutable_labels()->add_labels()->CopyFrom(
@@ -1010,7 +1010,7 @@ TEST_F(OversubscriptionTest, QoSCorrectionKill)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 10");
 
@@ -1119,7 +1119,7 @@ TEST_F(OversubscriptionTest, QoSCorrectionKillPartitionAware)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 10");
 
@@ -1229,7 +1229,7 @@ TEST_F(OversubscriptionTest, UpdateAllocatorOnSchedulerFailover)
   // it doesn't have the capability set.
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
   EXPECT_TRUE(Resources(offers1.get()[0].resources()).revocable().empty());
 
   // Now launch the second (i.e., failover) scheduler using the
@@ -1277,7 +1277,7 @@ TEST_F(OversubscriptionTest, UpdateAllocatorOnSchedulerFailover)
   Clock::resume();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
   EXPECT_TRUE(Resources(offers1.get()[0].resources()).revocable().empty());
 
   // Check if framework receives revocable offers.
@@ -1289,7 +1289,7 @@ TEST_F(OversubscriptionTest, UpdateAllocatorOnSchedulerFailover)
   estimations.put(revocable);
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
   EXPECT_EQ(allocatedResources(revocable, framework2.role()),
             Resources(offers2.get()[0].resources()));
 
@@ -1349,7 +1349,7 @@ TEST_F(OversubscriptionTest, RemoveCapabilitiesOnSchedulerFailover)
 
   // Initially the framework will get all regular resources.
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
   EXPECT_TRUE(Resources(offers1.get()[0].resources()).revocable().empty());
 
   Future<vector<Offer>> offers2;
@@ -1363,7 +1363,7 @@ TEST_F(OversubscriptionTest, RemoveCapabilitiesOnSchedulerFailover)
 
   // Now the framework will get revocable resources.
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
   EXPECT_EQ(allocatedResources(revocable, framework1.role()),
             Resources(offers2.get()[0].resources()));
 
@@ -1400,7 +1400,7 @@ TEST_F(OversubscriptionTest, RemoveCapabilitiesOnSchedulerFailover)
   Clock::resume();
 
   AWAIT_READY(offers3);
-  EXPECT_FALSE(offers3->empty());
+  ASSERT_FALSE(offers3->empty());
   EXPECT_TRUE(Resources(offers3.get()[0].resources()).revocable().empty());
 
   driver1.stop();

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/persistent_volume_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/persistent_volume_tests.cpp b/src/tests/persistent_volume_tests.cpp
index 3e1d1fe..1b35af4 100644
--- a/src/tests/persistent_volume_tests.cpp
+++ b/src/tests/persistent_volume_tests.cpp
@@ -287,7 +287,7 @@ TEST_P(PersistentVolumeTest, CreateAndDestroyPersistentVolumes)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -369,7 +369,7 @@ TEST_P(PersistentVolumeTest, CreateAndDestroyPersistentVolumes)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -448,7 +448,7 @@ TEST_P(PersistentVolumeTest, ResourcesCheckpointing)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -520,7 +520,7 @@ TEST_P(PersistentVolumeTest, PreparePersistentVolume)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -588,7 +588,7 @@ TEST_P(PersistentVolumeTest, MasterFailover)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   Offer offer1 = offers1.get()[0];
 
@@ -644,7 +644,7 @@ TEST_P(PersistentVolumeTest, MasterFailover)
   AWAIT_READY(slaveReregistered);
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
 
   Offer offer2 = offers2.get()[0];
 
@@ -691,7 +691,7 @@ TEST_P(PersistentVolumeTest, IncompatibleCheckpointedResources)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -787,7 +787,7 @@ TEST_P(PersistentVolumeTest, AccessPersistentVolume)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -951,7 +951,7 @@ TEST_P(PersistentVolumeTest, SharedPersistentVolumeMultipleTasks)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -1064,7 +1064,7 @@ TEST_P(PersistentVolumeTest, SharedPersistentVolumeRescindOnDestroy)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   Offer offer1 = offers1.get()[0];
 
@@ -1235,7 +1235,7 @@ TEST_P(PersistentVolumeTest, SharedPersistentVolumeMultipleFrameworks)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   Offer offer1 = offers1.get()[0];
 
@@ -1314,7 +1314,7 @@ TEST_P(PersistentVolumeTest, SharedPersistentVolumeMultipleFrameworks)
   driver2.start();
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
 
   Offer offer2 = offers2.get()[0];
 
@@ -1408,7 +1408,7 @@ TEST_P(PersistentVolumeTest, SharedPersistentVolumeMasterFailover)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   Offer offer1 = offers1.get()[0];
 
@@ -1485,7 +1485,7 @@ TEST_P(PersistentVolumeTest, SharedPersistentVolumeMasterFailover)
   AWAIT_READY(slaveReregistered);
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
 
   Offer offer2 = offers2.get()[0];
 
@@ -1553,7 +1553,7 @@ TEST_P(PersistentVolumeTest, DestroyPersistentVolumeMultipleTasks)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -1642,7 +1642,7 @@ TEST_P(PersistentVolumeTest, DestroyPersistentVolumeMultipleTasks)
 
   // Await the offer containing the persistent volume.
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -1673,7 +1673,7 @@ TEST_P(PersistentVolumeTest, DestroyPersistentVolumeMultipleTasks)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -1708,7 +1708,7 @@ TEST_P(PersistentVolumeTest, DestroyPersistentVolumeMultipleTasks)
   Clock::resume();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -1763,7 +1763,7 @@ TEST_P(PersistentVolumeTest, SharedPersistentVolumeMultipleIterations)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -1901,7 +1901,7 @@ TEST_P(PersistentVolumeTest, SlaveRecovery)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -2052,7 +2052,7 @@ TEST_P(PersistentVolumeTest, GoodACLCreateThenDestroy)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -2086,7 +2086,7 @@ TEST_P(PersistentVolumeTest, GoodACLCreateThenDestroy)
 
   // Await the offer containing the persistent volume.
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -2118,7 +2118,7 @@ TEST_P(PersistentVolumeTest, GoodACLCreateThenDestroy)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -2204,7 +2204,7 @@ TEST_P(PersistentVolumeTest, GoodACLNoPrincipal)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -2238,7 +2238,7 @@ TEST_P(PersistentVolumeTest, GoodACLNoPrincipal)
 
   // Await the offer containing the persistent volume.
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -2268,7 +2268,7 @@ TEST_P(PersistentVolumeTest, GoodACLNoPrincipal)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -2364,7 +2364,7 @@ TEST_P(PersistentVolumeTest, BadACLNoPrincipal)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -2390,7 +2390,7 @@ TEST_P(PersistentVolumeTest, BadACLNoPrincipal)
     Clock::advance(masterFlags.allocation_interval);
 
     AWAIT_READY(offers);
-    EXPECT_FALSE(offers->empty());
+    ASSERT_FALSE(offers->empty());
 
     offer = offers.get()[0];
 
@@ -2421,7 +2421,7 @@ TEST_P(PersistentVolumeTest, BadACLNoPrincipal)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -2446,7 +2446,7 @@ TEST_P(PersistentVolumeTest, BadACLNoPrincipal)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -2471,7 +2471,7 @@ TEST_P(PersistentVolumeTest, BadACLNoPrincipal)
   driver1.reviveOffers();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -2489,7 +2489,7 @@ TEST_P(PersistentVolumeTest, BadACLNoPrincipal)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -2588,7 +2588,7 @@ TEST_P(PersistentVolumeTest, BadACLDropCreateAndDestroy)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 
@@ -2614,7 +2614,7 @@ TEST_P(PersistentVolumeTest, BadACLDropCreateAndDestroy)
     Clock::advance(masterFlags.allocation_interval);
 
     AWAIT_READY(offers);
-    EXPECT_FALSE(offers->empty());
+    ASSERT_FALSE(offers->empty());
 
     offer = offers.get()[0];
 
@@ -2645,7 +2645,7 @@ TEST_P(PersistentVolumeTest, BadACLDropCreateAndDestroy)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -2670,7 +2670,7 @@ TEST_P(PersistentVolumeTest, BadACLDropCreateAndDestroy)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -2695,7 +2695,7 @@ TEST_P(PersistentVolumeTest, BadACLDropCreateAndDestroy)
   driver1.reviveOffers();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 
@@ -2713,7 +2713,7 @@ TEST_P(PersistentVolumeTest, BadACLDropCreateAndDestroy)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   offer = offers.get()[0];
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/reconciliation_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/reconciliation_tests.cpp b/src/tests/reconciliation_tests.cpp
index 7289618..64a1d3d 100644
--- a/src/tests/reconciliation_tests.cpp
+++ b/src/tests/reconciliation_tests.cpp
@@ -882,7 +882,7 @@ TEST_F(ReconciliationTest, PendingTask)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Return a pending future from authorizer.
   Future<Nothing> authorize;

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/registrar_zookeeper_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/registrar_zookeeper_tests.cpp b/src/tests/registrar_zookeeper_tests.cpp
index 96bae29..9d3ea5f 100644
--- a/src/tests/registrar_zookeeper_tests.cpp
+++ b/src/tests/registrar_zookeeper_tests.cpp
@@ -85,7 +85,7 @@ TEST_F(RegistrarZooKeeperTest, TaskRunning)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "dummy", DEFAULT_EXECUTOR_ID);
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/reservation_endpoints_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/reservation_endpoints_tests.cpp b/src/tests/reservation_endpoints_tests.cpp
index 3278732..5a6e9a7 100644
--- a/src/tests/reservation_endpoints_tests.cpp
+++ b/src/tests/reservation_endpoints_tests.cpp
@@ -1592,7 +1592,7 @@ TEST_F(ReservationEndpointsTest, AgentStateEndpointResources)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Offer offer = offers.get()[0];
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/resource_offers_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/resource_offers_tests.cpp b/src/tests/resource_offers_tests.cpp
index dc9c230..5564636 100644
--- a/src/tests/resource_offers_tests.cpp
+++ b/src/tests/resource_offers_tests.cpp
@@ -94,7 +94,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   EXPECT_GE(10u, offers->size());
 
   Resources resources(offers.get()[0].resources());
@@ -173,7 +173,7 @@ TEST_F(ResourceOffersTest, ResourcesGetReofferedWhenUnused)
   driver1.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   vector<TaskInfo> tasks; // Use nothing!
   driver1.launchTasks(offers.get()[0].id(), tasks);
@@ -223,7 +223,7 @@ TEST_F(ResourceOffersTest, ResourcesGetReofferedAfterTaskInfoError)
   driver1.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("");

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/scheduler_driver_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/scheduler_driver_tests.cpp b/src/tests/scheduler_driver_tests.cpp
index d2aff69..14d872b 100644
--- a/src/tests/scheduler_driver_tests.cpp
+++ b/src/tests/scheduler_driver_tests.cpp
@@ -296,7 +296,7 @@ TEST_F(MesosSchedulerDriverTest, ExplicitAcknowledgementsMasterGeneratedUpdate)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task using no resources.
   TaskInfo task;

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/scheduler_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/scheduler_tests.cpp b/src/tests/scheduler_tests.cpp
index 21f8825..4eda96e 100644
--- a/src/tests/scheduler_tests.cpp
+++ b/src/tests/scheduler_tests.cpp
@@ -459,7 +459,7 @@ TEST_P(SchedulerTest, TaskRunning)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   EXPECT_CALL(*executor, connected(_))
     .WillOnce(v1::executor::SendSubscribe(frameworkId, evolve(executorId)));
@@ -589,7 +589,7 @@ TEST_P(SchedulerTest, TaskGroupRunning)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   Future<RunTaskGroupMessage> runTaskGroupMessage =
     FUTURE_PROTOBUF(RunTaskGroupMessage(), master.get()->pid, slave.get()->pid);
@@ -783,7 +783,7 @@ TEST_P(SchedulerTest, ReconcileTask)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   EXPECT_CALL(*executor, connected(_))
     .WillOnce(v1::executor::SendSubscribe(frameworkId, evolve(executorId)));
@@ -911,7 +911,7 @@ TEST_P(SchedulerTest, KillTask)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   EXPECT_CALL(*executor, connected(_))
     .WillOnce(v1::executor::SendSubscribe(frameworkId, evolve(executorId)));
@@ -1057,7 +1057,7 @@ TEST_P(SchedulerTest, ShutdownExecutor)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   EXPECT_CALL(*executor, connected(_))
     .WillOnce(v1::executor::SendSubscribe(frameworkId, evolve(executorId)));
@@ -1274,7 +1274,7 @@ TEST_P(SchedulerTest, Revive)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->offers().empty());
+  ASSERT_FALSE(offers1->offers().empty());
 
   const v1::Offer& offer = offers1->offers(0);
 
@@ -1317,7 +1317,7 @@ TEST_P(SchedulerTest, Revive)
   }
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->offers().empty());
+  ASSERT_FALSE(offers2->offers().empty());
   ASSERT_EQ(offer.resources(), offers2->offers(0).resources());
 }
 
@@ -1372,7 +1372,7 @@ TEST_P(SchedulerTest, Suppress)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->offers().empty());
+  ASSERT_FALSE(offers1->offers().empty());
 
   const v1::Offer& offer = offers1->offers(0);
 
@@ -1432,7 +1432,7 @@ TEST_P(SchedulerTest, Suppress)
 
   AWAIT_READY(offers2);
 
-  EXPECT_FALSE(offers2->offers().empty());
+  ASSERT_FALSE(offers2->offers().empty());
   ASSERT_EQ(offer.resources(), offers2->offers(0).resources());
 }
 
@@ -1572,7 +1572,7 @@ TEST_P(SchedulerTest, Message)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   EXPECT_CALL(*executor, connected(_))
     .WillOnce(v1::executor::SendSubscribe(frameworkId, evolve(executorId)));
@@ -2031,7 +2031,7 @@ TEST_P(SchedulerSSLTest, RunTaskAndTeardown)
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   EXPECT_CALL(*executor, connected(_))
     .WillOnce(v1::executor::SendSubscribe(frameworkId, evolve(executorId)));

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/slave_authorization_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_authorization_tests.cpp b/src/tests/slave_authorization_tests.cpp
index 30eceae..4c7d37f 100644
--- a/src/tests/slave_authorization_tests.cpp
+++ b/src/tests/slave_authorization_tests.cpp
@@ -257,7 +257,7 @@ TYPED_TEST(SlaveAuthorizerTest, FilterStateEndpoint)
   AWAIT_READY(frameworkIdSuperhero);
 
   AWAIT_READY(offersSuperhero);
-  EXPECT_FALSE(offersSuperhero->empty());
+  ASSERT_FALSE(offersSuperhero->empty());
 
   // Define a task which will run on executorSuperhero of frameworkSuperhero.
   TaskInfo taskSuperhero;
@@ -306,7 +306,7 @@ TYPED_TEST(SlaveAuthorizerTest, FilterStateEndpoint)
   AWAIT_READY(frameworkIdMuggle);
 
   AWAIT_READY(offersMuggle);
-  EXPECT_FALSE(offersMuggle->empty());
+  ASSERT_FALSE(offersMuggle->empty());
 
   // Define a task which will run on executorMuggle of frameworkMuggle.
   TaskInfo taskMuggle;
@@ -612,7 +612,7 @@ TYPED_TEST(SlaveAuthorizerTest, AuthorizeRunTaskOnAgent)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers.get().empty());
+  ASSERT_FALSE(offers.get().empty());
 
   Offer offer = offers.get()[0];
 
@@ -716,7 +716,7 @@ TEST_F(ExecutorAuthorizationTest, RunTaskGroup)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers.get().empty());
+  ASSERT_FALSE(offers.get().empty());
 
   Offer offer = offers.get()[0];
 
@@ -838,7 +838,7 @@ TEST_F(ExecutorAuthorizationTest, FailedSubscribe)
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   Future<v1::executor::Mesos*> executorLib;
   EXPECT_CALL(*executor, connected(_))
@@ -997,7 +997,7 @@ TEST_F(ExecutorAuthorizationTest, FailedApiCalls)
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   Future<v1::executor::Mesos*> executorLib;
   EXPECT_CALL(*executor, connected(_))


[3/4] mesos git commit: Changed `EXPECT` to `ASSERT` when relying on the assertion afterwards.

Posted by gr...@apache.org.
http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/slave_recovery_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_recovery_tests.cpp b/src/tests/slave_recovery_tests.cpp
index 0e46748..0cd2b5d 100644
--- a/src/tests/slave_recovery_tests.cpp
+++ b/src/tests/slave_recovery_tests.cpp
@@ -217,7 +217,7 @@ TYPED_TEST(SlaveRecoveryTest, RecoverSlaveState)
   UPID frameworkPid = subscribeMessage->from;
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   SlaveID slaveId = offers.get()[0].slave_id();
 
@@ -388,7 +388,7 @@ TYPED_TEST(SlaveRecoveryTest, RecoverStatusUpdateManager)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
 
@@ -475,7 +475,7 @@ TYPED_TEST(SlaveRecoveryTest, DISABLED_ReconnectHTTPExecutor)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task with the HTTP based command executor.
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
@@ -608,7 +608,7 @@ TYPED_TEST(SlaveRecoveryTest, DISABLED_ROOT_CGROUPS_ReconnectDefaultExecutor)
   executorInfo.mutable_framework_id()->CopyFrom(devolve(frameworkId));
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
   const SlaveID slaveId = devolve(offer.agent_id());
@@ -757,7 +757,7 @@ TYPED_TEST(SlaveRecoveryTest, ReconnectExecutor)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
 
@@ -851,7 +851,7 @@ TYPED_TEST(SlaveRecoveryTest, ReconnectExecutorRetry)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
 
@@ -970,7 +970,7 @@ TYPED_TEST(SlaveRecoveryTest, PingTimeoutDuringRecovery)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
 
@@ -1111,7 +1111,7 @@ TYPED_TEST(SlaveRecoveryTest, DISABLED_RecoverUnregisteredHTTPExecutor)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
 
@@ -1223,7 +1223,7 @@ TYPED_TEST(SlaveRecoveryTest, RecoverUnregisteredExecutor)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
 
@@ -1337,7 +1337,7 @@ TYPED_TEST(SlaveRecoveryTest, KillQueuedTaskDuringExecutorRegistration)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
 
@@ -1447,7 +1447,7 @@ TYPED_TEST(SlaveRecoveryTest, RecoverTerminatedHTTPExecutor)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
 
@@ -1588,7 +1588,7 @@ TYPED_TEST(SlaveRecoveryTest, RecoverTerminatedExecutor)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
 
@@ -1719,7 +1719,7 @@ TYPED_TEST(SlaveRecoveryTest, DISABLED_RecoveryTimeout)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
 
@@ -1811,7 +1811,7 @@ TYPED_TEST(SlaveRecoveryTest, RecoverCompletedExecutor)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "exit 0");
 
@@ -1905,7 +1905,7 @@ TYPED_TEST(SlaveRecoveryTest, DISABLED_CleanupHTTPExecutor)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task with the HTTP based command executor.
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
@@ -2006,7 +2006,7 @@ TYPED_TEST(SlaveRecoveryTest, CleanupExecutor)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
 
@@ -2107,7 +2107,7 @@ TYPED_TEST(SlaveRecoveryTest, RemoveNonCheckpointingFramework)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch 2 tasks from this offer.
   vector<TaskInfo> tasks;
@@ -2222,7 +2222,7 @@ TYPED_TEST(SlaveRecoveryTest, NonCheckpointingFramework)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
 
@@ -2320,7 +2320,7 @@ TYPED_TEST(SlaveRecoveryTest, DISABLED_KillTaskWithHTTPExecutor)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
 
@@ -2435,7 +2435,7 @@ TYPED_TEST(SlaveRecoveryTest, KillTask)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
 
@@ -2553,7 +2553,7 @@ TYPED_TEST(SlaveRecoveryTest, Reboot)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
 
@@ -2927,7 +2927,7 @@ TYPED_TEST(SlaveRecoveryTest, GCExecutor)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
 
@@ -3064,7 +3064,7 @@ TYPED_TEST(SlaveRecoveryTest, ShutdownSlave)
 
   AWAIT_READY(offers1);
 
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
 
@@ -3129,7 +3129,7 @@ TYPED_TEST(SlaveRecoveryTest, ShutdownSlave)
   // Ensure that the slave registered with a new id.
   AWAIT_READY(offers3);
 
-  EXPECT_FALSE(offers3->empty());
+  ASSERT_FALSE(offers3->empty());
   // Make sure all slave resources are reoffered.
   EXPECT_EQ(Resources(offers1.get()[0].resources()),
             Resources(offers3.get()[0].resources()));
@@ -3182,7 +3182,7 @@ TYPED_TEST(SlaveRecoveryTest, ShutdownSlaveSIGUSR1)
 
   AWAIT_READY(offers);
 
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
 
@@ -3407,7 +3407,7 @@ TYPED_TEST(SlaveRecoveryTest, ReconcileKillTask)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
 
@@ -3508,7 +3508,7 @@ TYPED_TEST(SlaveRecoveryTest, ReconcileShutdownFramework)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Capture the framework id.
   FrameworkID frameworkId = offers.get()[0].framework_id();
@@ -3654,7 +3654,7 @@ TYPED_TEST(SlaveRecoveryTest, ReconcileTasksMissingFromSlave)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   // Start a task on the slave so that the master has knowledge of it.
   // We'll ensure the slave does not have this task when it
@@ -3819,7 +3819,7 @@ TYPED_TEST(SlaveRecoveryTest, SchedulerFailover)
 
   AWAIT_READY(frameworkId);
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   // Create a long running task.
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
@@ -3971,7 +3971,7 @@ TYPED_TEST(SlaveRecoveryTest, MasterFailover)
 
   AWAIT_READY(frameworkRegisteredMessage);
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   TaskInfo task = createTask(offers1.get()[0], "sleep 1000");
 
@@ -4106,7 +4106,7 @@ TYPED_TEST(SlaveRecoveryTest, MultipleFrameworks)
   driver1.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   // Use part of the resources in the offer so that the rest can be
   // offered to framework 2.
@@ -4145,7 +4145,7 @@ TYPED_TEST(SlaveRecoveryTest, MultipleFrameworks)
   driver2.start();
 
   AWAIT_READY(offers2);
-  EXPECT_FALSE(offers2->empty());
+  ASSERT_FALSE(offers2->empty());
 
   // Framework 2 launches a task.
   TaskInfo task2 = createTask(offers2.get()[0], "sleep 1000");
@@ -4439,7 +4439,7 @@ TYPED_TEST(SlaveRecoveryTest, RestartBeforeContainerizerLaunch)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
 
@@ -4541,7 +4541,7 @@ TEST_F(MesosContainerizerSlaveRecoveryTest, ResourceStatistics)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 1000");
 
@@ -4646,7 +4646,7 @@ TEST_F(MesosContainerizerSlaveRecoveryTest, CGROUPS_ROOT_PidNamespaceForward)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   SlaveID slaveId = offers1.get()[0].slave_id();
 
@@ -4750,7 +4750,7 @@ TEST_F(MesosContainerizerSlaveRecoveryTest, CGROUPS_ROOT_PidNamespaceBackward)
   driver.start();
 
   AWAIT_READY(offers1);
-  EXPECT_FALSE(offers1->empty());
+  ASSERT_FALSE(offers1->empty());
 
   SlaveID slaveId = offers1.get()[0].slave_id();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/slave_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index 1bdadce..0a578ff 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -246,7 +246,7 @@ TEST_F(SlaveTest, DuplicateTerminalUpdateBeforeAck)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   ExecutorDriver* execDriver;
   EXPECT_CALL(exec, registered(_, _, _, _))
@@ -360,7 +360,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, ShutdownUnregisteredExecutor)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task with the command executor.
   TaskInfo task;
@@ -476,7 +476,7 @@ TEST_F(SlaveTest, ExecutorTimeoutCausedBySlowFetch)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task with the command executor.
   // The task uses a URI that needs to be fetched by the HDFS client
@@ -575,7 +575,7 @@ TEST_F(SlaveTest, RemoveUnregisteredTerminatedExecutor)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("");
@@ -661,7 +661,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, CommandTaskWithArguments)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task with the command executor.
   TaskInfo task;
@@ -727,7 +727,7 @@ TEST_F(SlaveTest, CommandTaskWithKillPolicy)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   Offer offer = offers.get()[0];
 
   TaskInfo task;
@@ -1025,7 +1025,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task with the command executor.
   TaskInfo task;
@@ -1129,7 +1129,7 @@ TEST_F(SlaveTest, DISABLED_ROOT_RunTaskWithCommandInfoWithUser)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // HACK: Launch a prepare task as root to prepare the binaries.
   // This task creates the lt-mesos-executor binary in the build dir.
@@ -1181,7 +1181,7 @@ TEST_F(SlaveTest, DISABLED_ROOT_RunTaskWithCommandInfoWithUser)
     .WillRepeatedly(Return()); // Ignore subsequent offers.
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task with the command executor.
   TaskInfo task;
@@ -1257,7 +1257,7 @@ TEST_F(SlaveTest, IgnoreNonLeaderStatusUpdateAcknowledgement)
   const UPID schedulerPid = frameworkRegisteredMessage->to;
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "", DEFAULT_EXECUTOR_ID);
 
@@ -1434,7 +1434,7 @@ TEST_F(SlaveTest, MetricsSlaveLaunchErrors)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   const Offer offer = offers.get()[0];
 
   // Verify that we start with no launch failures.
@@ -1614,7 +1614,7 @@ TEST_F(SlaveTest, StateEndpoint)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   Resources executorResources = Resources::parse("cpus:0.1;mem:32").get();
   executorResources.allocate("*");
@@ -1771,7 +1771,7 @@ TEST_F(SlaveTest, GetStateTaskGroupPending)
   executorInfo.mutable_framework_id()->CopyFrom(devolve(frameworkId));
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
   const SlaveID slaveId = devolve(offer.agent_id());
@@ -2092,7 +2092,7 @@ TEST_F(SlaveTest, HTTPExecutorBadAuthentication)
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   Future<v1::executor::Mesos*> executorLib;
   EXPECT_CALL(*executor, connected(_))
@@ -2264,7 +2264,7 @@ TEST_F(SlaveTest, StatisticsEndpointMissingStatistics)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 
@@ -2370,7 +2370,7 @@ TEST_F(SlaveTest, StatisticsEndpointRunningExecutor)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 
@@ -2933,7 +2933,7 @@ TEST_F(SlaveTest, TerminalTaskContainerizerUpdateFailsWithLost)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   Offer offer = offers.get()[0];
 
   // Start two tasks.
@@ -3046,7 +3046,7 @@ TEST_F(SlaveTest, TerminalTaskContainerizerUpdateFailsWithGone)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   Offer offer = offers.get()[0];
 
   // Start two tasks.
@@ -4015,7 +4015,7 @@ TEST_F(SlaveTest, KillTaskBetweenRunTaskParts)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("");
@@ -4124,7 +4124,7 @@ TEST_F(SlaveTest, KillMultiplePendingTasks)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_NE(0u, offers->size());
+  ASSERT_FALSE(offers->empty());
 
   // We only pause the clock after receiving the offer since the
   // agent uses a delay to re-register.
@@ -4256,7 +4256,7 @@ TEST_F(SlaveTest, KillQueuedTaskDuringExecutorRegistration)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("");
@@ -4379,7 +4379,7 @@ TEST_F(SlaveTest, KillTaskUnregisteredHTTPExecutor)
   executorInfo.mutable_framework_id()->CopyFrom(devolve(frameworkId));
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
   const SlaveID slaveId = devolve(offer.agent_id());
@@ -4607,7 +4607,7 @@ TEST_F(SlaveTest, ContainerizerUsageFailure)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   const Offer& offer = offers.get()[0];
 
@@ -4685,7 +4685,7 @@ TEST_F(SlaveTest, DiscoveryInfoAndPorts)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(
       offers.get()[0],
@@ -4794,7 +4794,7 @@ TEST_F(SlaveTest, ExecutorLabels)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("");
@@ -4886,7 +4886,7 @@ TEST_F(SlaveTest, TaskLabels)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task;
   task.set_name("");
@@ -4990,7 +4990,7 @@ TEST_F(SlaveTest, TaskStatusLabels)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(
       offers.get()[0],
@@ -5095,7 +5095,7 @@ TEST_F(SlaveTest, TaskStatusContainerStatus)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(
       offers.get()[0],
@@ -5193,7 +5193,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, ExecutorEnvironmentVariables)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   // Launch a task with the command executor.
   TaskInfo task;
@@ -5530,7 +5530,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, HTTPSchedulerSlaveRestart)
     FUTURE_MESSAGE(Eq(RegisterExecutorMessage().GetTypeName()), _, _);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   SlaveID slaveId = offers.get()[0].slave_id();
 
@@ -5676,7 +5676,7 @@ TEST_F(SlaveTest, ExecutorShutdownGracePeriod)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
   Offer offer = offers.get()[0];
 
   // Customize executor shutdown grace period to be larger than the
@@ -5842,7 +5842,7 @@ TEST_F(SlaveTest, RunTaskGroup)
   executorInfo.mutable_framework_id()->CopyFrom(devolve(frameworkId));
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   EXPECT_CALL(*executor, connected(_))
     .WillOnce(v1::executor::SendSubscribe(frameworkId, evolve(executorId)));
@@ -7008,7 +7008,7 @@ TEST_F(SlaveTest, KillTaskGroupBetweenRunTaskParts)
   executorInfo.mutable_framework_id()->CopyFrom(devolve(frameworkId));
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   EXPECT_CALL(*executor, connected(_))
     .Times(0);
@@ -7206,7 +7206,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, DefaultExecutorCommandInfo)
   executorInfo.mutable_framework_id()->CopyFrom(devolve(frameworkId));
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   Future<ContainerConfig> containerConfig;
   EXPECT_CALL(containerizer, launch(_, _, _, _))
@@ -7321,7 +7321,7 @@ TEST_F(SlaveTest, KillQueuedTaskGroup)
   executorInfo.mutable_framework_id()->CopyFrom(devolve(frameworkId));
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
+  ASSERT_FALSE(offers->offers().empty());
 
   Future<v1::executor::Mesos*> executorLibrary;
   EXPECT_CALL(*executor, connected(_))
@@ -7639,7 +7639,7 @@ TEST_F(SlaveTest, ShutdownV0ExecutorIfItReregistersWithoutReconnect)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   EXPECT_CALL(exec, registered(_, _, _, _));
 
@@ -7742,7 +7742,7 @@ TEST_F(SlaveTest, IgnoreV0ExecutorIfItReregistersWithoutReconnect)
   Clock::advance(masterFlags.allocation_interval);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   EXPECT_CALL(exec, registered(_, _, _, _));
 
@@ -7844,7 +7844,7 @@ TEST_F(SlaveTest, DisconnectedExecutorDropsMessages)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   FrameworkID frameworkId = offers->front().framework_id();
 
@@ -7978,7 +7978,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, ExecutorReregistrationTimeoutFlag)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers->front(), "sleep 1000");
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/status_update_manager_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/status_update_manager_tests.cpp b/src/tests/status_update_manager_tests.cpp
index 6922ee3..24d6a99 100644
--- a/src/tests/status_update_manager_tests.cpp
+++ b/src/tests/status_update_manager_tests.cpp
@@ -126,7 +126,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(StatusUpdateManagerTest, CheckpointStatusUpdate)
 
   AWAIT_READY(frameworkId);
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   EXPECT_CALL(exec, registered(_, _, _, _));
 
@@ -215,7 +215,7 @@ TEST_F(StatusUpdateManagerTest, RetryStatusUpdate)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   EXPECT_CALL(exec, registered(_, _, _, _));
 
@@ -286,7 +286,7 @@ TEST_F(StatusUpdateManagerTest, IgnoreDuplicateStatusUpdateAck)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   ExecutorDriver* execDriver;
   EXPECT_CALL(exec, registered(_, _, _, _))
@@ -402,7 +402,7 @@ TEST_F(StatusUpdateManagerTest, IgnoreUnexpectedStatusUpdateAck)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   ExecutorDriver* execDriver;
   EXPECT_CALL(exec, registered(_, _, _, _))
@@ -492,7 +492,7 @@ TEST_F(StatusUpdateManagerTest, DuplicateTerminalUpdateAfterAck)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   ExecutorDriver* execDriver;
   EXPECT_CALL(exec, registered(_, _, _, _))
@@ -587,7 +587,7 @@ TEST_F(StatusUpdateManagerTest, DuplicateUpdateBeforeAck)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   ExecutorDriver* execDriver;
   EXPECT_CALL(exec, registered(_, _, _, _))
@@ -772,7 +772,7 @@ TEST_F(StatusUpdateManagerTest, DuplicatedTerminalStatusUpdate)
   driver.start();
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   ExecutorDriver* execDriver;
   EXPECT_CALL(exec, registered(_, _, _, _))

http://git-wip-us.apache.org/repos/asf/mesos/blob/2a6f6b7a/src/tests/teardown_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/teardown_tests.cpp b/src/tests/teardown_tests.cpp
index 8834333..5eada4f 100644
--- a/src/tests/teardown_tests.cpp
+++ b/src/tests/teardown_tests.cpp
@@ -349,7 +349,7 @@ TEST_F(TeardownTest, RecoveredFrameworkAfterMasterFailover)
   AWAIT_READY(frameworkId);
 
   AWAIT_READY(offers);
-  EXPECT_FALSE(offers->empty());
+  ASSERT_FALSE(offers->empty());
 
   TaskInfo task = createTask(offers.get()[0], "sleep 100");
 


[2/4] mesos git commit: Cleaned up DefaultExecutor tests.

Posted by gr...@apache.org.
Cleaned up DefaultExecutor tests.

Updated the DefaultExecutor tests to use test helpers where possible.
Also made the boilerplate initialization code consistent across tests.

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


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/e7df335a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/e7df335a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/e7df335a

Branch: refs/heads/master
Commit: e7df335a484131450ff15bcd2ee325ea40dc8155
Parents: 1f4d7ef
Author: Gastón Kleiman <ga...@mesosphere.io>
Authored: Wed Sep 13 09:21:23 2017 -0700
Committer: Greg Mann <gr...@gmail.com>
Committed: Wed Sep 13 10:50:58 2017 -0700

----------------------------------------------------------------------
 src/tests/default_executor_tests.cpp | 816 +++++++++---------------------
 1 file changed, 239 insertions(+), 577 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e7df335a/src/tests/default_executor_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/default_executor_tests.cpp b/src/tests/default_executor_tests.cpp
index 219891c..0815fb8 100644
--- a/src/tests/default_executor_tests.cpp
+++ b/src/tests/default_executor_tests.cpp
@@ -136,16 +136,8 @@ TEST_P(DefaultExecutorTest, TaskRunning)
 
   auto scheduler = std::make_shared<v1::MockHTTPScheduler>();
 
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(FutureSatisfy(&connected));
-
-  v1::scheduler::TestMesos mesos(
-      master.get()->pid,
-      ContentType::PROTOBUF,
-      scheduler);
-
-  AWAIT_READY(connected);
+    .WillOnce(v1::scheduler::SendSubscribe(v1::DEFAULT_FRAMEWORK_INFO));
 
   Future<v1::scheduler::Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -159,14 +151,10 @@ TEST_P(DefaultExecutorTest, TaskRunning)
   EXPECT_CALL(*scheduler, heartbeat(_))
     .WillRepeatedly(Return()); // Ignore heartbeats.
 
-  {
-    Call call;
-    call.set_type(Call::SUBSCRIBE);
-    Call::Subscribe* subscribe = call.mutable_subscribe();
-    subscribe->mutable_framework_info()->CopyFrom(v1::DEFAULT_FRAMEWORK_INFO);
-
-    mesos.send(call);
-  }
+  v1::scheduler::TestMesos mesos(
+      master.get()->pid,
+      ContentType::PROTOBUF,
+      scheduler);
 
   AWAIT_READY(subscribed);
   v1::FrameworkID frameworkId(subscribed->framework_id());
@@ -174,11 +162,12 @@ TEST_P(DefaultExecutorTest, TaskRunning)
   v1::Resources resources =
     v1::Resources::parse("cpus:0.1;mem:32;disk:32").get();
 
-  v1::ExecutorInfo executorInfo;
-  executorInfo.set_type(v1::ExecutorInfo::DEFAULT);
-  executorInfo.mutable_executor_id()->CopyFrom(v1::DEFAULT_EXECUTOR_ID);
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
-  executorInfo.mutable_resources()->CopyFrom(resources);
+  v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
+      v1::DEFAULT_EXECUTOR_ID,
+      None(),
+      resources,
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   AWAIT_READY(offers);
   EXPECT_FALSE(offers->offers().empty());
@@ -186,35 +175,19 @@ TEST_P(DefaultExecutorTest, TaskRunning)
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
-  v1::TaskInfo taskInfo =
-    v1::createTask(agentId, resources, SLEEP_COMMAND(1000));
-
-  v1::TaskGroupInfo taskGroup;
-  taskGroup.add_tasks()->CopyFrom(taskInfo);
-
   Future<v1::scheduler::Event::Update> update;
   EXPECT_CALL(*scheduler, update(_, _))
     .WillOnce(FutureArg<1>(&update));
 
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACCEPT);
-
-    Call::Accept* accept = call.mutable_accept();
-    accept->add_offer_ids()->CopyFrom(offer.id());
-
-    v1::Offer::Operation* operation = accept->add_operations();
-    operation->set_type(v1::Offer::Operation::LAUNCH_GROUP);
-
-    v1::Offer::Operation::LaunchGroup* launchGroup =
-      operation->mutable_launch_group();
-
-    launchGroup->mutable_executor()->CopyFrom(executorInfo);
-    launchGroup->mutable_task_group()->CopyFrom(taskGroup);
+  v1::TaskInfo taskInfo =
+    v1::createTask(agentId, resources, SLEEP_COMMAND(1000));
 
-    mesos.send(call);
-  }
+  mesos.send(
+      v1::createCallAccept(
+          frameworkId,
+          offer,
+          {v1::LAUNCH_GROUP(
+              executorInfo, v1::createTaskGroupInfo({taskInfo}))}));
 
   AWAIT_READY(update);
 
@@ -270,16 +243,8 @@ TEST_P(DefaultExecutorTest, KillTask)
 
   auto scheduler = std::make_shared<v1::MockHTTPScheduler>();
 
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(FutureSatisfy(&connected));
-
-  v1::scheduler::TestMesos mesos(
-      master.get()->pid,
-      ContentType::PROTOBUF,
-      scheduler);
-
-  AWAIT_READY(connected);
+    .WillOnce(v1::scheduler::SendSubscribe(v1::DEFAULT_FRAMEWORK_INFO));
 
   Future<v1::scheduler::Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -292,14 +257,10 @@ TEST_P(DefaultExecutorTest, KillTask)
   EXPECT_CALL(*scheduler, heartbeat(_))
     .WillRepeatedly(Return()); // Ignore heartbeats.
 
-  {
-    Call call;
-    call.set_type(Call::SUBSCRIBE);
-    Call::Subscribe* subscribe = call.mutable_subscribe();
-    subscribe->mutable_framework_info()->CopyFrom(v1::DEFAULT_FRAMEWORK_INFO);
-
-    mesos.send(call);
-  }
+  v1::scheduler::TestMesos mesos(
+      master.get()->pid,
+      ContentType::PROTOBUF,
+      scheduler);
 
   AWAIT_READY(subscribed);
   v1::FrameworkID frameworkId(subscribed->framework_id());
@@ -307,11 +268,12 @@ TEST_P(DefaultExecutorTest, KillTask)
   v1::Resources resources =
     v1::Resources::parse("cpus:0.1;mem:32;disk:32").get();
 
-  v1::ExecutorInfo executorInfo;
-  executorInfo.set_type(v1::ExecutorInfo::DEFAULT);
-  executorInfo.mutable_executor_id()->CopyFrom(v1::DEFAULT_EXECUTOR_ID);
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
-  executorInfo.mutable_resources()->CopyFrom(resources);
+  v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
+      v1::DEFAULT_EXECUTOR_ID,
+      None(),
+      resources,
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   AWAIT_READY(offers1);
   EXPECT_FALSE(offers1->offers().empty());
@@ -325,17 +287,19 @@ TEST_P(DefaultExecutorTest, KillTask)
   v1::TaskInfo taskInfo2 =
     v1::createTask(agentId, resources, SLEEP_COMMAND(1000));
 
-  v1::TaskGroupInfo taskGroup1;
-  taskGroup1.add_tasks()->CopyFrom(taskInfo1);
-  taskGroup1.add_tasks()->CopyFrom(taskInfo2);
-
   const hashset<v1::TaskID> tasks1{taskInfo1.task_id(), taskInfo2.task_id()};
 
   Future<v1::scheduler::Event::Update> runningUpdate1;
   Future<v1::scheduler::Event::Update> runningUpdate2;
   EXPECT_CALL(*scheduler, update(_, _))
-    .WillOnce(FutureArg<1>(&runningUpdate1))
-    .WillOnce(FutureArg<1>(&runningUpdate2));
+    .WillOnce(
+        DoAll(
+            FutureArg<1>(&runningUpdate1),
+            v1::scheduler::SendAcknowledge(frameworkId, agentId)))
+    .WillOnce(
+        DoAll(
+            FutureArg<1>(&runningUpdate2),
+            v1::scheduler::SendAcknowledge(frameworkId, agentId)));
 
   Future<v1::scheduler::Event::Offers> offers2;
   EXPECT_CALL(*scheduler, offers(_, _))
@@ -343,25 +307,14 @@ TEST_P(DefaultExecutorTest, KillTask)
     .WillRepeatedly(Return());
 
   {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACCEPT);
-
-    Call::Accept* accept = call.mutable_accept();
-    accept->add_offer_ids()->CopyFrom(offer1.id());
-
-    v1::Offer::Operation* operation = accept->add_operations();
-    operation->set_type(v1::Offer::Operation::LAUNCH_GROUP);
+    v1::Offer::Operation launchGroup = v1::LAUNCH_GROUP(
+        executorInfo,
+        v1::createTaskGroupInfo({taskInfo1, taskInfo2}));
+    Call call = v1::createCallAccept(frameworkId, offer1, {launchGroup});
 
     // Set a 0s filter to immediately get another offer to launch
     // the second task group.
-    accept->mutable_filters()->set_refuse_seconds(0);
-
-    v1::Offer::Operation::LaunchGroup* launchGroup =
-      operation->mutable_launch_group();
-
-    launchGroup->mutable_executor()->CopyFrom(executorInfo);
-    launchGroup->mutable_task_group()->CopyFrom(taskGroup1);
+    call.mutable_accept()->mutable_filters()->set_refuse_seconds(0);
 
     mesos.send(call);
   }
@@ -386,88 +339,25 @@ TEST_P(DefaultExecutorTest, KillTask)
   v1::TaskInfo taskInfo3 =
     v1::createTask(agentId, resources, SLEEP_COMMAND(1000));
 
-  v1::TaskGroupInfo taskGroup2;
-  taskGroup2.add_tasks()->CopyFrom(taskInfo3);
-
   Future<v1::scheduler::Event::Update> runningUpdate3;
   EXPECT_CALL(*scheduler, update(_, _))
-    .WillOnce(FutureArg<1>(&runningUpdate3));
+    .WillOnce(
+        DoAll(
+            FutureArg<1>(&runningUpdate3),
+            v1::scheduler::SendAcknowledge(frameworkId, offer2.agent_id())));
 
   // Launch the second task group.
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACCEPT);
-
-    Call::Accept* accept = call.mutable_accept();
-    accept->add_offer_ids()->CopyFrom(offer2.id());
-
-    v1::Offer::Operation* operation = accept->add_operations();
-    operation->set_type(v1::Offer::Operation::LAUNCH_GROUP);
-
-    v1::Offer::Operation::LaunchGroup* launchGroup =
-      operation->mutable_launch_group();
-
-    launchGroup->mutable_executor()->CopyFrom(executorInfo);
-    launchGroup->mutable_task_group()->CopyFrom(taskGroup2);
-
-    mesos.send(call);
-  }
+  mesos.send(
+      v1::createCallAccept(
+          frameworkId,
+          offer2,
+          {v1::LAUNCH_GROUP(
+              executorInfo, v1::createTaskGroupInfo({taskInfo3}))}));
 
   AWAIT_READY(runningUpdate3);
   ASSERT_EQ(TASK_RUNNING, runningUpdate3->status().state());
   ASSERT_EQ(taskInfo3.task_id(), runningUpdate3->status().task_id());
 
-  // Acknowledge the TASK_RUNNING updates to receive the next updates.
-
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACKNOWLEDGE);
-
-    Call::Acknowledge* acknowledge = call.mutable_acknowledge();
-
-    acknowledge->mutable_task_id()->CopyFrom(
-        runningUpdate1->status().task_id());
-
-    acknowledge->mutable_agent_id()->CopyFrom(offer1.agent_id());
-    acknowledge->set_uuid(runningUpdate1->status().uuid());
-
-    mesos.send(call);
-  }
-
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACKNOWLEDGE);
-
-    Call::Acknowledge* acknowledge = call.mutable_acknowledge();
-
-    acknowledge->mutable_task_id()->CopyFrom(
-        runningUpdate2->status().task_id());
-
-    acknowledge->mutable_agent_id()->CopyFrom(offer1.agent_id());
-    acknowledge->set_uuid(runningUpdate2->status().uuid());
-
-    mesos.send(call);
-  }
-
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACKNOWLEDGE);
-
-    Call::Acknowledge* acknowledge = call.mutable_acknowledge();
-
-    acknowledge->mutable_task_id()->CopyFrom(
-        runningUpdate3->status().task_id());
-
-    acknowledge->mutable_agent_id()->CopyFrom(offer2.agent_id());
-    acknowledge->set_uuid(runningUpdate3->status().uuid());
-
-    mesos.send(call);
-  }
-
   Future<v1::scheduler::Event::Update> killedUpdate1;
   Future<v1::scheduler::Event::Update> killedUpdate2;
   EXPECT_CALL(*scheduler, update(_, _))
@@ -556,16 +446,8 @@ TEST_P(DefaultExecutorTest, KillTaskGroupOnTaskFailure)
 
   auto scheduler = std::make_shared<v1::MockHTTPScheduler>();
 
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(FutureSatisfy(&connected));
-
-  v1::scheduler::TestMesos mesos(
-      master.get()->pid,
-      ContentType::PROTOBUF,
-      scheduler);
-
-  AWAIT_READY(connected);
+    .WillOnce(v1::scheduler::SendSubscribe(v1::DEFAULT_FRAMEWORK_INFO));
 
   Future<v1::scheduler::Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -579,14 +461,10 @@ TEST_P(DefaultExecutorTest, KillTaskGroupOnTaskFailure)
   EXPECT_CALL(*scheduler, heartbeat(_))
     .WillRepeatedly(Return()); // Ignore heartbeats.
 
-  {
-    Call call;
-    call.set_type(Call::SUBSCRIBE);
-    Call::Subscribe* subscribe = call.mutable_subscribe();
-    subscribe->mutable_framework_info()->CopyFrom(v1::DEFAULT_FRAMEWORK_INFO);
-
-    mesos.send(call);
-  }
+  v1::scheduler::TestMesos mesos(
+      master.get()->pid,
+      ContentType::PROTOBUF,
+      scheduler);
 
   AWAIT_READY(subscribed);
   v1::FrameworkID frameworkId(subscribed->framework_id());
@@ -594,11 +472,12 @@ TEST_P(DefaultExecutorTest, KillTaskGroupOnTaskFailure)
   v1::Resources resources =
       v1::Resources::parse("cpus:0.1;mem:32;disk:32").get();
 
-  v1::ExecutorInfo executorInfo;
-  executorInfo.set_type(v1::ExecutorInfo::DEFAULT);
-  executorInfo.mutable_executor_id()->CopyFrom(v1::DEFAULT_EXECUTOR_ID);
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
-  executorInfo.mutable_resources()->CopyFrom(resources);
+  v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
+      v1::DEFAULT_EXECUTOR_ID,
+      None(),
+      resources,
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   AWAIT_READY(offers);
   EXPECT_FALSE(offers->offers().empty());
@@ -614,35 +493,18 @@ TEST_P(DefaultExecutorTest, KillTaskGroupOnTaskFailure)
 
   const hashset<v1::TaskID> tasks{taskInfo1.task_id(), taskInfo2.task_id()};
 
-  v1::TaskGroupInfo taskGroup;
-  taskGroup.add_tasks()->CopyFrom(taskInfo1);
-  taskGroup.add_tasks()->CopyFrom(taskInfo2);
-
   Future<v1::scheduler::Event::Update> runningUpdate1;
   Future<v1::scheduler::Event::Update> runningUpdate2;
   EXPECT_CALL(*scheduler, update(_, _))
     .WillOnce(FutureArg<1>(&runningUpdate1))
     .WillOnce(FutureArg<1>(&runningUpdate2));
 
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACCEPT);
-
-    Call::Accept* accept = call.mutable_accept();
-    accept->add_offer_ids()->CopyFrom(offer.id());
-
-    v1::Offer::Operation* operation = accept->add_operations();
-    operation->set_type(v1::Offer::Operation::LAUNCH_GROUP);
-
-    v1::Offer::Operation::LaunchGroup* launchGroup =
-      operation->mutable_launch_group();
-
-    launchGroup->mutable_executor()->CopyFrom(executorInfo);
-    launchGroup->mutable_task_group()->CopyFrom(taskGroup);
-
-    mesos.send(call);
-  }
+  mesos.send(
+      v1::createCallAccept(
+          frameworkId,
+          offer,
+          {v1::LAUNCH_GROUP(
+              executorInfo, v1::createTaskGroupInfo({taskInfo1, taskInfo2}))}));
 
   AWAIT_READY(runningUpdate1);
   ASSERT_EQ(TASK_RUNNING, runningUpdate1->status().state());
@@ -735,16 +597,8 @@ TEST_P(DefaultExecutorTest, TaskUsesExecutor)
 
   auto scheduler = std::make_shared<v1::MockHTTPScheduler>();
 
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(FutureSatisfy(&connected));
-
-  v1::scheduler::TestMesos mesos(
-      master.get()->pid,
-      ContentType::PROTOBUF,
-      scheduler);
-
-  AWAIT_READY(connected);
+    .WillOnce(v1::scheduler::SendSubscribe(v1::DEFAULT_FRAMEWORK_INFO));
 
   Future<v1::scheduler::Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -758,14 +612,10 @@ TEST_P(DefaultExecutorTest, TaskUsesExecutor)
   EXPECT_CALL(*scheduler, heartbeat(_))
     .WillRepeatedly(Return()); // Ignore heartbeats.
 
-  {
-    Call call;
-    call.set_type(Call::SUBSCRIBE);
-    Call::Subscribe* subscribe = call.mutable_subscribe();
-    subscribe->mutable_framework_info()->CopyFrom(v1::DEFAULT_FRAMEWORK_INFO);
-
-    mesos.send(call);
-  }
+  v1::scheduler::TestMesos mesos(
+      master.get()->pid,
+      ContentType::PROTOBUF,
+      scheduler);
 
   AWAIT_READY(subscribed);
   v1::FrameworkID frameworkId(subscribed->framework_id());
@@ -773,11 +623,14 @@ TEST_P(DefaultExecutorTest, TaskUsesExecutor)
   v1::Resources resources =
     v1::Resources::parse("cpus:0.1;mem:32;disk:32").get();
 
-  v1::ExecutorInfo executorInfo;
-  executorInfo.set_type(v1::ExecutorInfo::DEFAULT);
-  executorInfo.mutable_executor_id()->CopyFrom(v1::DEFAULT_EXECUTOR_ID);
+  v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
+      v1::DEFAULT_EXECUTOR_ID,
+      None(),
+      resources,
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
+
   executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
-  executorInfo.mutable_resources()->CopyFrom(resources);
 
   AWAIT_READY(offers);
   EXPECT_FALSE(offers->offers().empty());
@@ -785,37 +638,21 @@ TEST_P(DefaultExecutorTest, TaskUsesExecutor)
   const v1::Offer& offer = offers->offers(0);
   const v1::AgentID& agentId = offer.agent_id();
 
-  v1::TaskInfo taskInfo =
-    v1::createTask(agentId, resources, SLEEP_COMMAND(1000));
-
-  taskInfo.mutable_executor()->CopyFrom(executorInfo);
-
-  v1::TaskGroupInfo taskGroup;
-  taskGroup.add_tasks()->CopyFrom(taskInfo);
-
   Future<v1::scheduler::Event::Update> update;
   EXPECT_CALL(*scheduler, update(_, _))
     .WillOnce(FutureArg<1>(&update));
 
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACCEPT);
-
-    Call::Accept* accept = call.mutable_accept();
-    accept->add_offer_ids()->CopyFrom(offer.id());
-
-    v1::Offer::Operation* operation = accept->add_operations();
-    operation->set_type(v1::Offer::Operation::LAUNCH_GROUP);
-
-    v1::Offer::Operation::LaunchGroup* launchGroup =
-      operation->mutable_launch_group();
+  v1::TaskInfo taskInfo =
+    v1::createTask(agentId, resources, SLEEP_COMMAND(1000));
 
-    launchGroup->mutable_executor()->CopyFrom(executorInfo);
-    launchGroup->mutable_task_group()->CopyFrom(taskGroup);
+  taskInfo.mutable_executor()->CopyFrom(executorInfo);
 
-    mesos.send(call);
-  }
+  mesos.send(
+      v1::createCallAccept(
+          frameworkId,
+          offer,
+          {v1::LAUNCH_GROUP(
+              executorInfo, v1::createTaskGroupInfo({taskInfo}))}));
 
   AWAIT_READY(update);
 
@@ -837,23 +674,19 @@ TEST_P(DefaultExecutorTest, ROOT_ContainerStatusForTask)
   flags.containerizers = GetParam();
 
   Owned<MasterDetector> detector = master.get()->createDetector();
-
   Try<Owned<cluster::Slave>> slave = StartSlave(detector.get(), flags);
   ASSERT_SOME(slave);
 
   auto scheduler = std::make_shared<v1::MockHTTPScheduler>();
 
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(DoAll(
-        v1::scheduler::SendSubscribe(v1::DEFAULT_FRAMEWORK_INFO),
-        FutureSatisfy(&connected)));
+    .WillOnce(v1::scheduler::SendSubscribe(v1::DEFAULT_FRAMEWORK_INFO));
 
-  Future<Event::Subscribed> subscribed;
+  Future<v1::scheduler::Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
     .WillOnce(FutureArg<1>(&subscribed));
 
-  Future<Event::Offers> offers;
+  Future<v1::scheduler::Event::Offers> offers;
   EXPECT_CALL(*scheduler, offers(_, _))
     .WillOnce(FutureArg<1>(&offers))
     .WillRepeatedly(Return());
@@ -866,53 +699,47 @@ TEST_P(DefaultExecutorTest, ROOT_ContainerStatusForTask)
       ContentType::PROTOBUF,
       scheduler);
 
-  AWAIT_READY(connected);
-
   AWAIT_READY(subscribed);
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
+  v1::Resources resources =
+    v1::Resources::parse("cpus:0.1;mem:32;disk:32").get();
+
   v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
-      "test_default_executor",
+      v1::DEFAULT_EXECUTOR_ID,
       None(),
-      "cpus:0.1;mem:32;disk:32",
-      v1::ExecutorInfo::DEFAULT);
-
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
+      resources,
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   AWAIT_READY(offers);
   EXPECT_FALSE(offers->offers().empty());
 
   const v1::Offer& offer = offers->offers(0);
+  const v1::AgentID& agentId = offer.agent_id();
 
-  v1::TaskInfo task1 = v1::createTask(
-      offer.agent_id(),
-      v1::Resources::parse("cpus:0.1;mem:32;disk:32").get(),
-      v1::createCommandInfo(SLEEP_COMMAND(1000)));
-
-  v1::TaskInfo task2 = v1::createTask(
-      offer.agent_id(),
-      v1::Resources::parse("cpus:0.1;mem:32;disk:32").get(),
-      v1::createCommandInfo(SLEEP_COMMAND(1000)));
+  v1::TaskInfo task1 = v1::createTask(agentId, resources, SLEEP_COMMAND(1000));
 
-  v1::Offer::Operation launchGroup = v1::LAUNCH_GROUP(
-      executorInfo,
-      v1::createTaskGroupInfo({task1, task2}));
+  v1::TaskInfo task2 = v1::createTask(agentId, resources, SLEEP_COMMAND(1000));
 
   Future<Event::Update> updateRunning1;
   Future<Event::Update> updateRunning2;
   EXPECT_CALL(*scheduler, update(_, _))
-    .WillOnce(DoAll(
-        FutureArg<1>(&updateRunning1),
-        v1::scheduler::SendAcknowledge(
-            frameworkId,
-            offer.agent_id())))
-    .WillOnce(DoAll(
-        FutureArg<1>(&updateRunning2),
-        v1::scheduler::SendAcknowledge(
-            frameworkId,
-            offer.agent_id())));
+    .WillOnce(
+        DoAll(
+            FutureArg<1>(&updateRunning1),
+            v1::scheduler::SendAcknowledge(frameworkId, agentId)))
+    .WillOnce(
+        DoAll(
+            FutureArg<1>(&updateRunning2),
+            v1::scheduler::SendAcknowledge(frameworkId, agentId)));
 
-  mesos.send(v1::createCallAccept(frameworkId, offer, {launchGroup}));
+  mesos.send(
+      v1::createCallAccept(
+          frameworkId,
+          offer,
+          {v1::LAUNCH_GROUP(
+              executorInfo, v1::createTaskGroupInfo({task1, task2}))}));
 
   AWAIT_READY(updateRunning1);
   AWAIT_READY(updateRunning2);
@@ -952,16 +779,8 @@ TEST_P(DefaultExecutorTest, CommitSuicideOnTaskFailure)
 
   auto scheduler = std::make_shared<v1::MockHTTPScheduler>();
 
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(FutureSatisfy(&connected));
-
-  v1::scheduler::TestMesos mesos(
-      master.get()->pid,
-      ContentType::PROTOBUF,
-      scheduler);
-
-  AWAIT_READY(connected);
+    .WillOnce(v1::scheduler::SendSubscribe(v1::DEFAULT_FRAMEWORK_INFO));
 
   Future<v1::scheduler::Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -975,14 +794,10 @@ TEST_P(DefaultExecutorTest, CommitSuicideOnTaskFailure)
   EXPECT_CALL(*scheduler, heartbeat(_))
     .WillRepeatedly(Return()); // Ignore heartbeats.
 
-  {
-    Call call;
-    call.set_type(Call::SUBSCRIBE);
-    Call::Subscribe* subscribe = call.mutable_subscribe();
-    subscribe->mutable_framework_info()->CopyFrom(v1::DEFAULT_FRAMEWORK_INFO);
-
-    mesos.send(call);
-  }
+  v1::scheduler::TestMesos mesos(
+      master.get()->pid,
+      ContentType::PROTOBUF,
+      scheduler);
 
   AWAIT_READY(subscribed);
   v1::FrameworkID frameworkId(subscribed->framework_id());
@@ -990,11 +805,12 @@ TEST_P(DefaultExecutorTest, CommitSuicideOnTaskFailure)
   v1::Resources resources =
     v1::Resources::parse("cpus:0.1;mem:32;disk:32").get();
 
-  v1::ExecutorInfo executorInfo;
-  executorInfo.set_type(v1::ExecutorInfo::DEFAULT);
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
-  executorInfo.mutable_executor_id()->CopyFrom(v1::DEFAULT_EXECUTOR_ID);
-  executorInfo.mutable_resources()->CopyFrom(resources);
+  v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
+      v1::DEFAULT_EXECUTOR_ID,
+      None(),
+      resources,
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   AWAIT_READY(offers);
   EXPECT_FALSE(offers->offers().empty());
@@ -1003,62 +819,31 @@ TEST_P(DefaultExecutorTest, CommitSuicideOnTaskFailure)
   const v1::AgentID& agentId = offer.agent_id();
 
   // The task exits with a non-zero status code.
-  v1::TaskInfo taskInfo1 = v1::createTask(agentId, resources, "exit 1");
-
-  v1::TaskGroupInfo taskGroup;
-  taskGroup.add_tasks()->CopyFrom(taskInfo1);
+  v1::TaskInfo taskInfo = v1::createTask(agentId, resources, "exit 1");
 
   Future<v1::scheduler::Event::Update> runningUpdate;
   Future<v1::scheduler::Event::Update> failedUpdate;
   EXPECT_CALL(*scheduler, update(_, _))
-    .WillOnce(FutureArg<1>(&runningUpdate))
+    .WillOnce(
+        DoAll(
+            FutureArg<1>(&runningUpdate),
+            v1::scheduler::SendAcknowledge(frameworkId, agentId)))
     .WillOnce(FutureArg<1>(&failedUpdate));
 
   Future<v1::scheduler::Event::Failure> executorFailure;
   EXPECT_CALL(*scheduler, failure(_, _))
     .WillOnce(FutureArg<1>(&executorFailure));
 
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACCEPT);
-
-    Call::Accept* accept = call.mutable_accept();
-    accept->add_offer_ids()->CopyFrom(offer.id());
-
-    v1::Offer::Operation* operation = accept->add_operations();
-    operation->set_type(v1::Offer::Operation::LAUNCH_GROUP);
-
-    v1::Offer::Operation::LaunchGroup* launchGroup =
-      operation->mutable_launch_group();
-
-    launchGroup->mutable_executor()->CopyFrom(executorInfo);
-    launchGroup->mutable_task_group()->CopyFrom(taskGroup);
-
-    mesos.send(call);
-  }
+  mesos.send(
+      v1::createCallAccept(
+          frameworkId,
+          offer,
+          {v1::LAUNCH_GROUP(
+              executorInfo, v1::createTaskGroupInfo({taskInfo}))}));
 
   AWAIT_READY(runningUpdate);
   ASSERT_EQ(TASK_RUNNING, runningUpdate->status().state());
 
-  // Acknowledge the TASK_RUNNING update to receive the next update.
-
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACKNOWLEDGE);
-
-    Call::Acknowledge* acknowledge = call.mutable_acknowledge();
-
-    acknowledge->mutable_task_id()->CopyFrom(
-        runningUpdate->status().task_id());
-
-    acknowledge->mutable_agent_id()->CopyFrom(offer.agent_id());
-    acknowledge->set_uuid(runningUpdate->status().uuid());
-
-    mesos.send(call);
-  }
-
   AWAIT_READY(failedUpdate);
   ASSERT_EQ(TASK_FAILED, failedUpdate->status().state());
 
@@ -1088,16 +873,8 @@ TEST_P(DefaultExecutorTest, CommitSuicideOnKillTask)
 
   auto scheduler = std::make_shared<v1::MockHTTPScheduler>();
 
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(FutureSatisfy(&connected));
-
-  v1::scheduler::TestMesos mesos(
-      master.get()->pid,
-      ContentType::PROTOBUF,
-      scheduler);
-
-  AWAIT_READY(connected);
+    .WillOnce(v1::scheduler::SendSubscribe(v1::DEFAULT_FRAMEWORK_INFO));
 
   Future<v1::scheduler::Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -1111,14 +888,10 @@ TEST_P(DefaultExecutorTest, CommitSuicideOnKillTask)
   EXPECT_CALL(*scheduler, heartbeat(_))
     .WillRepeatedly(Return()); // Ignore heartbeats.
 
-  {
-    Call call;
-    call.set_type(Call::SUBSCRIBE);
-    Call::Subscribe* subscribe = call.mutable_subscribe();
-    subscribe->mutable_framework_info()->CopyFrom(v1::DEFAULT_FRAMEWORK_INFO);
-
-    mesos.send(call);
-  }
+  v1::scheduler::TestMesos mesos(
+      master.get()->pid,
+      ContentType::PROTOBUF,
+      scheduler);
 
   AWAIT_READY(subscribed);
   v1::FrameworkID frameworkId(subscribed->framework_id());
@@ -1126,11 +899,12 @@ TEST_P(DefaultExecutorTest, CommitSuicideOnKillTask)
   v1::Resources resources =
     v1::Resources::parse("cpus:0.1;mem:32;disk:32").get();
 
-  v1::ExecutorInfo executorInfo;
-  executorInfo.set_type(v1::ExecutorInfo::DEFAULT);
-  executorInfo.mutable_executor_id()->CopyFrom(v1::DEFAULT_EXECUTOR_ID);
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
-  executorInfo.mutable_resources()->CopyFrom(resources);
+  v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
+      v1::DEFAULT_EXECUTOR_ID,
+      None(),
+      resources,
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   AWAIT_READY(offers);
   EXPECT_FALSE(offers->offers().empty());
@@ -1146,41 +920,30 @@ TEST_P(DefaultExecutorTest, CommitSuicideOnKillTask)
   v1::TaskInfo taskInfo2 =
     v1::createTask(agentId, resources, SLEEP_COMMAND(1000));
 
-  v1::TaskGroupInfo taskGroup;
-  taskGroup.add_tasks()->CopyFrom(taskInfo1);
-  taskGroup.add_tasks()->CopyFrom(taskInfo2);
-
   const hashset<v1::TaskID> tasks{taskInfo1.task_id(), taskInfo2.task_id()};
 
   Future<v1::scheduler::Event::Update> runningUpdate1;
   Future<v1::scheduler::Event::Update> runningUpdate2;
   EXPECT_CALL(*scheduler, update(_, _))
-    .WillOnce(FutureArg<1>(&runningUpdate1))
-    .WillOnce(FutureArg<1>(&runningUpdate2));
+    .WillOnce(
+        DoAll(
+            FutureArg<1>(&runningUpdate1),
+            v1::scheduler::SendAcknowledge(frameworkId, agentId)))
+    .WillOnce(
+        DoAll(
+            FutureArg<1>(&runningUpdate2),
+            v1::scheduler::SendAcknowledge(frameworkId, agentId)));
 
   Future<v1::scheduler::Event::Failure> executorFailure;
   EXPECT_CALL(*scheduler, failure(_, _))
     .WillOnce(FutureArg<1>(&executorFailure));
 
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACCEPT);
-
-    Call::Accept* accept = call.mutable_accept();
-    accept->add_offer_ids()->CopyFrom(offer.id());
-
-    v1::Offer::Operation* operation = accept->add_operations();
-    operation->set_type(v1::Offer::Operation::LAUNCH_GROUP);
-
-    v1::Offer::Operation::LaunchGroup* launchGroup =
-      operation->mutable_launch_group();
-
-    launchGroup->mutable_executor()->CopyFrom(executorInfo);
-    launchGroup->mutable_task_group()->CopyFrom(taskGroup);
-
-    mesos.send(call);
-  }
+  mesos.send(
+      v1::createCallAccept(
+          frameworkId,
+          offer,
+          {v1::LAUNCH_GROUP(
+              executorInfo, v1::createTaskGroupInfo({taskInfo1, taskInfo2}))}));
 
   AWAIT_READY(runningUpdate1);
   ASSERT_EQ(TASK_RUNNING, runningUpdate1->status().state());
@@ -1200,40 +963,6 @@ TEST_P(DefaultExecutorTest, CommitSuicideOnKillTask)
   EXPECT_CALL(*scheduler, update(_, _))
     .WillOnce(FutureArg<1>(&finishedUpdate));
 
-  // Acknowledge the TASK_RUNNING updates to receive the next updates.
-
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACKNOWLEDGE);
-
-    Call::Acknowledge* acknowledge = call.mutable_acknowledge();
-
-    acknowledge->mutable_task_id()->CopyFrom(
-        runningUpdate1->status().task_id());
-
-    acknowledge->mutable_agent_id()->CopyFrom(offer.agent_id());
-    acknowledge->set_uuid(runningUpdate1->status().uuid());
-
-    mesos.send(call);
-  }
-
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACKNOWLEDGE);
-
-    Call::Acknowledge* acknowledge = call.mutable_acknowledge();
-
-    acknowledge->mutable_task_id()->CopyFrom(
-        runningUpdate2->status().task_id());
-
-    acknowledge->mutable_agent_id()->CopyFrom(offer.agent_id());
-    acknowledge->set_uuid(runningUpdate2->status().uuid());
-
-    mesos.send(call);
-  }
-
   AWAIT_READY(finishedUpdate);
   ASSERT_EQ(TASK_FINISHED, finishedUpdate->status().state());
   ASSERT_EQ(taskInfo1.task_id(), finishedUpdate->status().task_id());
@@ -1286,19 +1015,11 @@ TEST_P(DefaultExecutorTest, ReservedResources)
 
   auto scheduler = std::make_shared<v1::MockHTTPScheduler>();
 
-  Future<Nothing> connected;
-  EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(FutureSatisfy(&connected));
-
-  v1::scheduler::TestMesos mesos(
-      master.get()->pid,
-      ContentType::PROTOBUF,
-      scheduler);
-
-  AWAIT_READY(connected);
-
   v1::FrameworkInfo frameworkInfo = v1::DEFAULT_FRAMEWORK_INFO;
-  frameworkInfo.set_role("role");
+  frameworkInfo.set_role(DEFAULT_TEST_ROLE);
+
+  EXPECT_CALL(*scheduler, connected(_))
+    .WillOnce(v1::scheduler::SendSubscribe(frameworkInfo));
 
   Future<v1::scheduler::Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -1306,23 +1027,26 @@ TEST_P(DefaultExecutorTest, ReservedResources)
 
   Future<v1::scheduler::Event::Offers> offers;
   EXPECT_CALL(*scheduler, offers(_, _))
-    .WillOnce(FutureArg<1>(&offers));
+    .WillOnce(FutureArg<1>(&offers))
+    .WillRepeatedly(Return());
 
   EXPECT_CALL(*scheduler, heartbeat(_))
     .WillRepeatedly(Return()); // Ignore heartbeats.
 
-  {
-    Call call;
-    call.set_type(Call::SUBSCRIBE);
-    Call::Subscribe* subscribe = call.mutable_subscribe();
-    subscribe->mutable_framework_info()->CopyFrom(frameworkInfo);
-
-    mesos.send(call);
-  }
+  v1::scheduler::TestMesos mesos(
+      master.get()->pid,
+      ContentType::PROTOBUF,
+      scheduler);
 
   AWAIT_READY(subscribed);
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
+  AWAIT_READY(offers);
+  EXPECT_FALSE(offers->offers().empty());
+
+  const v1::Offer& offer = offers->offers(0);
+  const v1::AgentID& agentId = offer.agent_id();
+
   v1::Resources unreserved =
     v1::Resources::parse("cpus:0.1;mem:32;disk:32").get();
 
@@ -1331,50 +1055,26 @@ TEST_P(DefaultExecutorTest, ReservedResources)
     unreserved.pushReservation(v1::createDynamicReservationInfo(
         frameworkInfo.role(), frameworkInfo.principal()));
 
-  v1::ExecutorInfo executorInfo;
-  executorInfo.set_type(v1::ExecutorInfo::DEFAULT);
-  executorInfo.mutable_executor_id()->CopyFrom(v1::DEFAULT_EXECUTOR_ID);
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
-  executorInfo.mutable_resources()->CopyFrom(reserved);
-
-  AWAIT_READY(offers);
-  EXPECT_FALSE(offers->offers().empty());
-
-  const v1::Offer& offer = offers->offers(0);
-  const v1::AgentID& agentId = offer.agent_id();
+  v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
+      v1::DEFAULT_EXECUTOR_ID,
+      None(),
+      reserved,
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   // Launch the task using unreserved resources.
   v1::TaskInfo taskInfo =
     v1::createTask(agentId, unreserved, SLEEP_COMMAND(1000));
 
-  v1::TaskGroupInfo taskGroup;
-  taskGroup.add_tasks()->CopyFrom(taskInfo);
+  v1::Offer::Operation reserve = v1::RESERVE(reserved);
+  v1::Offer::Operation launchGroup =
+    v1::LAUNCH_GROUP(executorInfo, v1::createTaskGroupInfo({taskInfo}));
 
   Future<v1::scheduler::Event::Update> runningUpdate;
   EXPECT_CALL(*scheduler, update(_, _))
     .WillOnce(FutureArg<1>(&runningUpdate));
 
-  {
-    Call call;
-    call.mutable_framework_id()->CopyFrom(frameworkId);
-    call.set_type(Call::ACCEPT);
-
-    Call::Accept* accept = call.mutable_accept();
-    accept->add_offer_ids()->CopyFrom(offer.id());
-
-    accept->add_operations()->CopyFrom(v1::RESERVE(reserved));
-
-    v1::Offer::Operation* operation = accept->add_operations();
-    operation->set_type(v1::Offer::Operation::LAUNCH_GROUP);
-
-    v1::Offer::Operation::LaunchGroup* launchGroup =
-      operation->mutable_launch_group();
-
-    launchGroup->mutable_executor()->CopyFrom(executorInfo);
-    launchGroup->mutable_task_group()->CopyFrom(taskGroup);
-
-    mesos.send(call);
-  }
+  mesos.send(v1::createCallAccept(frameworkId, offer, {reserve, launchGroup}));
 
   AWAIT_READY(runningUpdate);
   ASSERT_EQ(TASK_RUNNING, runningUpdate->status().state());
@@ -1415,17 +1115,8 @@ TEST_P(DefaultExecutorTest, SigkillExecutor)
 
   auto scheduler = std::make_shared<v1::MockHTTPScheduler>();
 
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(DoAll(v1::scheduler::SendSubscribe(v1::DEFAULT_FRAMEWORK_INFO),
-                    FutureSatisfy(&connected)));
-
-  v1::scheduler::TestMesos mesos(
-      master.get()->pid,
-      ContentType::PROTOBUF,
-      scheduler);
-
-  AWAIT_READY(connected);
+    .WillOnce(v1::scheduler::SendSubscribe(v1::DEFAULT_FRAMEWORK_INFO));
 
   Future<v1::scheduler::Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -1438,17 +1129,20 @@ TEST_P(DefaultExecutorTest, SigkillExecutor)
   EXPECT_CALL(*scheduler, heartbeat(_))
     .WillRepeatedly(Return()); // Ignore heartbeats.
 
+  v1::scheduler::TestMesos mesos(
+      master.get()->pid,
+      ContentType::PROTOBUF,
+      scheduler);
+
   AWAIT_READY(subscribed);
 
   v1::FrameworkID frameworkId(subscribed->framework_id());
   v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
-      "test_default_executor",
+      v1::DEFAULT_EXECUTOR_ID,
       None(),
       "cpus:0.1;mem:32;disk:32",
-      v1::ExecutorInfo::DEFAULT);
-
-  // Update `executorInfo` with the subscribed `frameworkId`.
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   AWAIT_READY(offers);
   ASSERT_FALSE(offers->offers().empty());
@@ -1523,19 +1217,8 @@ TEST_P(DefaultExecutorTest, ROOT_MultiTaskgroupSharePidNamespace)
 
   auto scheduler = std::make_shared<v1::MockHTTPScheduler>();
 
-  v1::FrameworkInfo frameworkInfo = v1::DEFAULT_FRAMEWORK_INFO;
-
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(DoAll(v1::scheduler::SendSubscribe(frameworkInfo),
-                    FutureSatisfy(&connected)));
-
-  v1::scheduler::TestMesos mesos(
-      master.get()->pid,
-      ContentType::PROTOBUF,
-      scheduler);
-
-  AWAIT_READY(connected);
+    .WillOnce(v1::scheduler::SendSubscribe(v1::DEFAULT_FRAMEWORK_INFO));
 
   Future<v1::scheduler::Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -1548,17 +1231,20 @@ TEST_P(DefaultExecutorTest, ROOT_MultiTaskgroupSharePidNamespace)
   EXPECT_CALL(*scheduler, heartbeat(_))
     .WillRepeatedly(Return()); // Ignore heartbeats.
 
+  v1::scheduler::TestMesos mesos(
+      master.get()->pid,
+      ContentType::PROTOBUF,
+      scheduler);
+
   AWAIT_READY(subscribed);
 
   v1::FrameworkID frameworkId(subscribed->framework_id());
   v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
-      "test_default_executor",
+      v1::DEFAULT_EXECUTOR_ID,
       None(),
       "cpus:0.1;mem:32;disk:32",
-      v1::ExecutorInfo::DEFAULT);
-
-  // Update `executorInfo` with the subscribed `frameworkId`.
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   AWAIT_READY(offers1);
   EXPECT_FALSE(offers1->offers().empty());
@@ -1745,17 +1431,8 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
   v1::FrameworkInfo frameworkInfo = v1::DEFAULT_FRAMEWORK_INFO;
   frameworkInfo.set_role(DEFAULT_TEST_ROLE);
 
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(DoAll(v1::scheduler::SendSubscribe(frameworkInfo),
-                    FutureSatisfy(&connected)));
-
-  v1::scheduler::TestMesos mesos(
-      master.get()->pid,
-      ContentType::PROTOBUF,
-      scheduler);
-
-  AWAIT_READY(connected);
+    .WillOnce(v1::scheduler::SendSubscribe(frameworkInfo));
 
   Future<Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -1769,6 +1446,11 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
   EXPECT_CALL(*scheduler, heartbeat(_))
     .WillRepeatedly(Return()); // Ignore heartbeats.
 
+  v1::scheduler::TestMesos mesos(
+      master.get()->pid,
+      ContentType::PROTOBUF,
+      scheduler);
+
   AWAIT_READY(subscribed);
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
@@ -1791,13 +1473,11 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
   v1::Resources executorResources = reserved.apply(v1::CREATE(volume)).get();
 
   v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
-      v1::DEFAULT_EXECUTOR_ID.value(),
+      v1::DEFAULT_EXECUTOR_ID,
       None(),
-      None(),
-      v1::ExecutorInfo::DEFAULT);
-
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
-  executorInfo.mutable_resources()->CopyFrom(executorResources);
+      executorResources,
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   AWAIT_READY(offers);
   EXPECT_FALSE(offers->offers().empty());
@@ -1888,17 +1568,8 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
   v1::FrameworkInfo frameworkInfo = v1::DEFAULT_FRAMEWORK_INFO;
   frameworkInfo.set_role(DEFAULT_TEST_ROLE);
 
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(DoAll(v1::scheduler::SendSubscribe(frameworkInfo),
-                    FutureSatisfy(&connected)));
-
-  v1::scheduler::TestMesos mesos(
-      master.get()->pid,
-      ContentType::PROTOBUF,
-      scheduler);
-
-  AWAIT_READY(connected);
+    .WillOnce(v1::scheduler::SendSubscribe(frameworkInfo));
 
   Future<Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -1912,6 +1583,11 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
   EXPECT_CALL(*scheduler, heartbeat(_))
     .WillRepeatedly(Return()); // Ignore heartbeats.
 
+  v1::scheduler::TestMesos mesos(
+      master.get()->pid,
+      ContentType::PROTOBUF,
+      scheduler);
+
   AWAIT_READY(subscribed);
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
@@ -1919,13 +1595,11 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
     v1::Resources::parse("cpus:0.1;mem:32;disk:32").get();
 
   v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
-      v1::DEFAULT_EXECUTOR_ID.value(),
+      v1::DEFAULT_EXECUTOR_ID,
       None(),
-      None(),
-      v1::ExecutorInfo::DEFAULT);
-
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
-  executorInfo.mutable_resources()->CopyFrom(unreserved);
+      unreserved,
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   AWAIT_READY(offers);
   EXPECT_FALSE(offers->offers().empty());
@@ -2012,10 +1686,8 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
   v1::FrameworkInfo frameworkInfo = v1::DEFAULT_FRAMEWORK_INFO;
   frameworkInfo.set_role(DEFAULT_TEST_ROLE);
 
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(DoAll(v1::scheduler::SendSubscribe(frameworkInfo),
-                    FutureSatisfy(&connected)));
+    .WillOnce(v1::scheduler::SendSubscribe(frameworkInfo));
 
   Future<Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -2034,8 +1706,6 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
       ContentType::PROTOBUF,
       scheduler);
 
-  AWAIT_READY(connected);
-
   AWAIT_READY(subscribed);
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
@@ -2064,13 +1734,11 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
     individualResources.apply(v1::CREATE(executorVolume)).get();
 
   v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
-      v1::DEFAULT_EXECUTOR_ID.value(),
+      v1::DEFAULT_EXECUTOR_ID,
       None(),
-      None(),
-      v1::ExecutorInfo::DEFAULT);
-
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
-  executorInfo.mutable_resources()->CopyFrom(executorResources);
+      executorResources,
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   AWAIT_READY(offers);
   ASSERT_FALSE(offers->offers().empty());
@@ -2227,10 +1895,8 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
   v1::FrameworkInfo frameworkInfo = v1::DEFAULT_FRAMEWORK_INFO;
   frameworkInfo.set_role(DEFAULT_TEST_ROLE);
 
-  Future<Nothing> connected;
   EXPECT_CALL(*scheduler, connected(_))
-    .WillOnce(DoAll(v1::scheduler::SendSubscribe(frameworkInfo),
-                    FutureSatisfy(&connected)));
+    .WillOnce(v1::scheduler::SendSubscribe(frameworkInfo));
 
   Future<Event::Subscribed> subscribed;
   EXPECT_CALL(*scheduler, subscribed(_, _))
@@ -2249,8 +1915,6 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
       ContentType::PROTOBUF,
       scheduler);
 
-  AWAIT_READY(connected);
-
   AWAIT_READY(subscribed);
   v1::FrameworkID frameworkId(subscribed->framework_id());
 
@@ -2279,13 +1943,11 @@ TEST_P_TEMP_DISABLED_ON_WINDOWS(
     individualResources.apply(v1::CREATE(executorVolume)).get();
 
   v1::ExecutorInfo executorInfo = v1::createExecutorInfo(
-      v1::DEFAULT_EXECUTOR_ID.value(),
+      v1::DEFAULT_EXECUTOR_ID,
       None(),
-      None(),
-      v1::ExecutorInfo::DEFAULT);
-
-  executorInfo.mutable_framework_id()->CopyFrom(frameworkId);
-  executorInfo.mutable_resources()->CopyFrom(executorResources);
+      executorResources,
+      v1::ExecutorInfo::DEFAULT,
+      frameworkId);
 
   AWAIT_READY(offers);
   ASSERT_FALSE(offers->offers().empty());