mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-08-06 15:02:41 +03:00
Squashed memory leaks to get clean test run with ASAN enabled.
This commit is contained in:
@@ -43,3 +43,28 @@ void wsrep_test::bf_abort_provider(wsrep::mock_server_state& sc,
|
|||||||
sc.provider().bf_abort(bf_seqno, tc.id(), victim_seqno);
|
sc.provider().bf_abort(bf_seqno, tc.id(), victim_seqno);
|
||||||
(void)victim_seqno;
|
(void)victim_seqno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wsrep_test::terminate_streaming_applier(
|
||||||
|
wsrep::mock_server_state& sc,
|
||||||
|
const wsrep::id& server_id,
|
||||||
|
wsrep::transaction_id transaction_id)
|
||||||
|
{
|
||||||
|
// Note that all other arguments than server_id and
|
||||||
|
// transaction_id are chosen arbitrarily and it is hoped
|
||||||
|
// that the mock implementation does not freak out about it.
|
||||||
|
wsrep::mock_client mc(sc, wsrep::client_id(10),
|
||||||
|
wsrep::client_state::m_high_priority);
|
||||||
|
mc.open(wsrep::client_id(10));
|
||||||
|
mc.before_command();
|
||||||
|
wsrep::mock_high_priority_service hps(sc, &mc, false);
|
||||||
|
wsrep::ws_handle ws_handle(transaction_id, (void*)(1));
|
||||||
|
wsrep::ws_meta ws_meta(wsrep::gtid(wsrep::id("cluster1"),
|
||||||
|
wsrep::seqno(100)),
|
||||||
|
wsrep::stid(server_id,
|
||||||
|
transaction_id,
|
||||||
|
wsrep::client_id(1)),
|
||||||
|
wsrep::seqno(0),
|
||||||
|
wsrep::provider::flag::rollback);
|
||||||
|
wsrep::const_buffer data(0, 0);
|
||||||
|
sc.on_apply(hps, ws_handle, ws_meta, data);
|
||||||
|
}
|
||||||
|
@@ -43,4 +43,10 @@ namespace wsrep_test
|
|||||||
void bf_abort_provider(wsrep::mock_server_state& sc,
|
void bf_abort_provider(wsrep::mock_server_state& sc,
|
||||||
const wsrep::transaction& tc,
|
const wsrep::transaction& tc,
|
||||||
wsrep::seqno bf_seqno);
|
wsrep::seqno bf_seqno);
|
||||||
|
|
||||||
|
// Terminate streaming applier by applying rollback fragment.
|
||||||
|
void terminate_streaming_applier(
|
||||||
|
wsrep::mock_server_state& sc,
|
||||||
|
const wsrep::id& server_id,
|
||||||
|
wsrep::transaction_id transaction_id);
|
||||||
}
|
}
|
||||||
|
@@ -1112,6 +1112,8 @@ BOOST_FIXTURE_TEST_CASE(transaction_streaming_1pc_bf_abort_during_fragment_remov
|
|||||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborted);
|
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborted);
|
||||||
BOOST_REQUIRE(cc.after_statement());
|
BOOST_REQUIRE(cc.after_statement());
|
||||||
BOOST_REQUIRE(tc.active() == false);
|
BOOST_REQUIRE(tc.active() == false);
|
||||||
|
wsrep_test::terminate_streaming_applier(sc, sc.id(),
|
||||||
|
wsrep::transaction_id(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1154,6 +1156,9 @@ BOOST_FIXTURE_TEST_CASE(transaction_row_streaming_bf_abort_executing,
|
|||||||
BOOST_REQUIRE(cc.before_rollback() == 0);
|
BOOST_REQUIRE(cc.before_rollback() == 0);
|
||||||
BOOST_REQUIRE(cc.after_rollback() == 0);
|
BOOST_REQUIRE(cc.after_rollback() == 0);
|
||||||
BOOST_REQUIRE(cc.after_statement());
|
BOOST_REQUIRE(cc.after_statement());
|
||||||
|
wsrep_test::terminate_streaming_applier(sc, sc.id(),
|
||||||
|
wsrep::transaction_id(1));
|
||||||
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Test streaming certification failure during fragment replication
|
// Test streaming certification failure during fragment replication
|
||||||
|
@@ -258,6 +258,8 @@ BOOST_FIXTURE_TEST_CASE(transaction_streaming_2pc_bf_abort_during_fragment_remov
|
|||||||
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborted);
|
BOOST_REQUIRE(tc.state() == wsrep::transaction::s_aborted);
|
||||||
BOOST_REQUIRE(cc.after_statement());
|
BOOST_REQUIRE(cc.after_statement());
|
||||||
BOOST_REQUIRE(tc.active() == false);
|
BOOST_REQUIRE(tc.active() == false);
|
||||||
|
wsrep_test::terminate_streaming_applier(sc, sc.id(),
|
||||||
|
wsrep::transaction_id(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
Reference in New Issue
Block a user