Created
July 18, 2014 16:12
-
-
Save mpenick/dcb6d4ae3344cc62e2f8 to your computer and use it in GitHub Desktop.
Crash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void kill_task(boost::shared_ptr<cql::cql_ccm_bridge_t> ccm) { | |
boost::this_thread::sleep_for(boost::chrono::milliseconds(10)); | |
ccm->decommission(2); | |
boost::this_thread::sleep_for(boost::chrono::milliseconds(10)); | |
ccm->decommission(3); | |
} | |
BOOST_AUTO_TEST_CASE(test_simple) | |
{ | |
test_utils::CassClusterPtr cluster = test_utils::make_shared(cass_cluster_new()); | |
const cql::cql_ccm_bridge_configuration_t& conf = cql::get_ccm_bridge_configuration(); | |
boost::shared_ptr<cql::cql_ccm_bridge_t> ccm = cql::cql_ccm_bridge_t::create(conf, "test", 3, 0); | |
test_utils::initialize_contact_points(cluster.get(), conf.ip_prefix(), 3, 0); | |
test_utils::CassFuturePtr session_future = test_utils::make_shared(cass_cluster_connect(cluster.get())); | |
test_utils::wait_and_check_error(session_future.get()); | |
test_utils::CassSessionPtr session = test_utils::make_shared(cass_future_get_session(session_future.get())); | |
PolicyTool policy_tool; | |
policy_tool.create_schema(session.get(), 3); | |
boost::shared_future<void> kill_future = boost::async(boost::launch::async, boost::bind(kill_task, ccm)); | |
policy_tool.init_return_error(session.get(), 10000, CASS_CONSISTENCY_ONE); | |
policy_tool.query_return_error(session.get(), 99999999, CASS_CONSISTENCY_ONE); | |
kill_future.wait(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment