You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/07/28 20:46:35 UTC

[3/3] mesos git commit: Added expectations for response types in log replica tests.

Added expectations for response types in log replica tests.

The `okay` field in `PromiseResponse` and `WriteResponse` are
deprecated. This adds a the analogous check for the `type` field that
replaces the `okay` field.

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


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

Branch: refs/heads/master
Commit: 26c806f09f27a9f016d85476f0ef62db91872b31
Parents: 9b5cfe6
Author: Joseph Wu <jo...@mesosphere.io>
Authored: Thu Jul 28 12:14:51 2016 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Thu Jul 28 12:14:51 2016 -0700

----------------------------------------------------------------------
 src/tests/log_tests.cpp | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/26c806f0/src/tests/log_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/log_tests.cpp b/src/tests/log_tests.cpp
index 2943f64..146a2dc 100644
--- a/src/tests/log_tests.cpp
+++ b/src/tests/log_tests.cpp
@@ -348,6 +348,7 @@ TEST_F(ReplicaTest, Promise)
   AWAIT_READY(future);
 
   response = future.get();
+  EXPECT_EQ(PromiseResponse::ACCEPT, response.type());
   EXPECT_TRUE(response.okay());
   EXPECT_EQ(2u, response.proposal());
   EXPECT_TRUE(response.has_position());
@@ -361,6 +362,7 @@ TEST_F(ReplicaTest, Promise)
   AWAIT_READY(future);
 
   response = future.get();
+  EXPECT_EQ(PromiseResponse::REJECT, response.type());
   EXPECT_FALSE(response.okay());
   EXPECT_EQ(2u, response.proposal()); // Highest proposal seen so far.
   EXPECT_FALSE(response.has_position());
@@ -373,6 +375,7 @@ TEST_F(ReplicaTest, Promise)
   AWAIT_READY(future);
 
   response = future.get();
+  EXPECT_EQ(PromiseResponse::ACCEPT, response.type());
   EXPECT_TRUE(response.okay());
   EXPECT_EQ(3u, response.proposal());
   EXPECT_TRUE(response.has_position());
@@ -400,6 +403,7 @@ TEST_F(ReplicaTest, Append)
   AWAIT_READY(future1);
 
   PromiseResponse response1 = future1.get();
+  EXPECT_EQ(PromiseResponse::ACCEPT, response1.type());
   EXPECT_TRUE(response1.okay());
   EXPECT_EQ(proposal, response1.proposal());
   EXPECT_TRUE(response1.has_position());
@@ -418,6 +422,7 @@ TEST_F(ReplicaTest, Append)
   AWAIT_READY(future2);
 
   WriteResponse response2 = future2.get();
+  EXPECT_EQ(WriteResponse::ACCEPT, response2.type());
   EXPECT_TRUE(response2.okay());
   EXPECT_EQ(proposal, response2.proposal());
   EXPECT_EQ(1u, response2.position());
@@ -467,6 +472,7 @@ TEST_F(ReplicaTest, Restore)
     AWAIT_READY(future1);
 
     PromiseResponse response1 = future1.get();
+    EXPECT_EQ(PromiseResponse::ACCEPT, response1.type());
     EXPECT_TRUE(response1.okay());
     EXPECT_EQ(proposal, response1.proposal());
     EXPECT_TRUE(response1.has_position());
@@ -485,6 +491,7 @@ TEST_F(ReplicaTest, Restore)
     AWAIT_READY(future2);
 
     WriteResponse response2 = future2.get();
+    EXPECT_EQ(WriteResponse::ACCEPT, response2.type());
     EXPECT_TRUE(response2.okay());
     EXPECT_EQ(proposal, response2.proposal());
     EXPECT_EQ(1u, response2.position());