@@ -6,7 +6,7 @@ class DataServiceFixture : public MessagingFixtureBase {
66 void SetUp () override {
77 MessagingFixtureBase::SetUp ();
88 start (true );
9- test_state_mgr::fill_data_vec (cli_buf);
9+ test_state_mgr::fill_data_vec (cli_buf, 8 );
1010 }
1111
1212 void TearDown () override {
@@ -94,6 +94,7 @@ TEST_F(DataServiceFixture, BasicTest1) {
9494 return folly::Unit ();
9595 }));
9696
97+
9798 auto repl_ctx1 = sm1->get_repl_context ();
9899 for (auto svr : repl_ctx1->_server ->get_config ()->get_servers ()) {
99100 if (svr->get_endpoint () == to_string (app_1_->id_ )) continue ;
@@ -107,6 +108,30 @@ TEST_F(DataServiceFixture, BasicTest1) {
107108
108109 folly::collectAll (results).via (folly::getGlobalCPUExecutor ()).get ();
109110
111+ // test big message
112+ LOGINFO (" Starting large object write test" )
113+ io_blob_list_t big_cli_buf;
114+ test_state_mgr::fill_data_vec_big (big_cli_buf, 4 * 1024 * 1024 );
115+ sm1->data_service_request_unidirectional (nuraft_mesg::role_regex::ALL, SEND_DATA, big_cli_buf)
116+ .deferValue ([](auto e) -> NullResult {
117+ EXPECT_TRUE (e.hasValue ());
118+ return folly::Unit ();
119+ }).get ();
120+ LOGINFO (" End large object write test" )
121+ LOGINFO (" Starting large object read test" )
122+
123+ sm4_1->data_service_request_bidirectional (nuraft_mesg::role_regex::LEADER, REQUEST_DATA, big_cli_buf)
124+ .deferValue ([](auto e) -> NullResult {
125+ EXPECT_TRUE (e.hasValue ());
126+ test_state_mgr::verify_data (e.value ().response_blob ());
127+ return folly::Unit ();
128+ }).get ();
129+ LOGINFO (" End large object read test" )
130+ for (auto & buf : big_cli_buf) {
131+ buf.buf_free ();
132+ }
133+
134+
110135 // add a new member to data_service_test_group and check if repl_ctx4 sends data to newly added member
111136 auto add_3 = app_4->instance_ ->add_member (data_group, app_3_->id_ );
112137 std::this_thread::sleep_for (std::chrono::seconds (1 ));
@@ -119,9 +144,9 @@ TEST_F(DataServiceFixture, BasicTest1) {
119144 .get ();
120145
121146 // TODO REVIEW THIS
122- // test_group: 4 (1 SEND_DATA) + 5 (1 REQUEST_DATA) + 1 (SEND_DATA to a peer) = 10
147+ // test_group: 4 (2 * 1 SEND_DATA) + 6 (1 REQUEST_DATA) + 1 (SEND_DATA to a peer) = 15
123148 // data_service_test_group: 1 (1 REQUEST_DATA) + 4 (1 SEND_DATA) = 5
124- EXPECT_EQ (test_state_mgr::get_server_counter (), 15 );
149+ EXPECT_EQ (test_state_mgr::get_server_counter (), 20 );
125150 app_5->instance_ ->leave_group (data_group);
126151 app_5->instance_ ->leave_group (group_id_);
127152 app_4->instance_ ->leave_group (data_group);
0 commit comments