You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2017/05/26 17:11:14 UTC

[8/9] mesos git commit: Added a test for evolving large protobuf message.

Added a test for evolving large protobuf message.

Before protobuf 3.2.0, this test would fail because the 64MB limit
imposed by older versions of protobuf.

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


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

Branch: refs/heads/master
Commit: a03c22a067af55e4c9dfd0d471b020690a575b39
Parents: 3451933
Author: Zhitao Li <zh...@gmail.com>
Authored: Fri May 26 10:00:33 2017 -0700
Committer: Anand Mazumdar <an...@apache.org>
Committed: Fri May 26 10:01:55 2017 -0700

----------------------------------------------------------------------
 src/tests/protobuf_utils_tests.cpp | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a03c22a0/src/tests/protobuf_utils_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/protobuf_utils_tests.cpp b/src/tests/protobuf_utils_tests.cpp
index 5239182..6ec3a8e 100644
--- a/src/tests/protobuf_utils_tests.cpp
+++ b/src/tests/protobuf_utils_tests.cpp
@@ -285,6 +285,31 @@ TEST(ProtobufUtilTest, AgentCapabilities)
   ASSERT_TRUE(capabilities.multiRole);
 }
 
+
+// Test large message evolve.
+// Before protobuf 3.3.0, this test would fail due to the 64MB limit
+// imposed by older version of protobuf.
+TEST(ProtobufUtilTest, LargeMessageEvolve)
+{
+  string data =
+    "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do "
+    "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim "
+    "ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut "
+    "aliquip ex ea commodo consequat. Duis aute irure dolor in "
+    "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla "
+    "pariatur. Excepteur sint occaecat cupidatat non proident, sunt in "
+    "culpa qui officia deserunt mollit anim id est laborum.";
+
+  while (Bytes(data.size()) < Megabytes(70)) {
+    data.append(data);
+  }
+
+  ExecutorInfo executorInfo_;
+  executorInfo_.set_data(data);
+
+  evolve(executorInfo_);
+}
+
 } // namespace tests {
 } // namespace internal {
 } // namespace mesos {