1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-30 07:23:07 +03:00

Use provider for replaying in mock client_context instead of

calling server context apply directly.
This commit is contained in:
Teemu Ollakka
2018-06-14 12:41:34 +03:00
parent 6246d9d3b8
commit ca6286d8b2
10 changed files with 80 additions and 77 deletions

View File

@ -3,7 +3,7 @@
# #
add_executable(wsrep-lib_test add_executable(wsrep-lib_test
fake_client_context.cpp mock_client_context.cpp
test_utils.cpp test_utils.cpp
id_test.cpp id_test.cpp
server_context_test.cpp server_context_test.cpp

View File

@ -5,8 +5,8 @@
#ifndef WSREP_TEST_CLIENT_CONTEXT_FIXTURE_HPP #ifndef WSREP_TEST_CLIENT_CONTEXT_FIXTURE_HPP
#define WSREP_TEST_CLIENT_CONTEXT_FIXTURE_HPP #define WSREP_TEST_CLIENT_CONTEXT_FIXTURE_HPP
#include "fake_server_context.hpp" #include "mock_server_context.hpp"
#include "fake_client_context.hpp" #include "mock_client_context.hpp"
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
@ -27,8 +27,8 @@ namespace
BOOST_REQUIRE(tc.active() == false); BOOST_REQUIRE(tc.active() == false);
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing); BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
} }
wsrep::fake_server_context sc; wsrep::mock_server_context sc;
wsrep::fake_client_context cc; wsrep::mock_client_context cc;
const wsrep::transaction_context& tc; const wsrep::transaction_context& tc;
}; };
@ -46,8 +46,8 @@ namespace
BOOST_REQUIRE(tc.active() == false); BOOST_REQUIRE(tc.active() == false);
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing); BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
} }
wsrep::fake_server_context sc; wsrep::mock_server_context sc;
wsrep::fake_client_context cc; wsrep::mock_client_context cc;
const wsrep::transaction_context& tc; const wsrep::transaction_context& tc;
}; };
@ -65,8 +65,8 @@ namespace
BOOST_REQUIRE(tc.active() == false); BOOST_REQUIRE(tc.active() == false);
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing); BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
} }
wsrep::fake_server_context sc; wsrep::mock_server_context sc;
wsrep::fake_client_context cc; wsrep::mock_client_context cc;
const wsrep::transaction_context& tc; const wsrep::transaction_context& tc;
}; };
@ -84,8 +84,8 @@ namespace
BOOST_REQUIRE(tc.active() == false); BOOST_REQUIRE(tc.active() == false);
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing); BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
} }
wsrep::fake_server_context sc; wsrep::mock_server_context sc;
wsrep::fake_client_context cc; wsrep::mock_client_context cc;
const wsrep::transaction_context& tc; const wsrep::transaction_context& tc;
}; };
@ -112,8 +112,8 @@ namespace
BOOST_REQUIRE(tc.certified() == true); BOOST_REQUIRE(tc.certified() == true);
BOOST_REQUIRE(tc.ordered() == true); BOOST_REQUIRE(tc.ordered() == true);
} }
wsrep::fake_server_context sc; wsrep::mock_server_context sc;
wsrep::fake_client_context cc; wsrep::mock_client_context cc;
const wsrep::transaction_context& tc; const wsrep::transaction_context& tc;
}; };
@ -140,8 +140,8 @@ namespace
BOOST_REQUIRE(tc.certified() == true); BOOST_REQUIRE(tc.certified() == true);
BOOST_REQUIRE(tc.ordered() == true); BOOST_REQUIRE(tc.ordered() == true);
} }
wsrep::fake_server_context sc; wsrep::mock_server_context sc;
wsrep::fake_client_context cc; wsrep::mock_client_context cc;
const wsrep::transaction_context& tc; const wsrep::transaction_context& tc;
}; };
@ -160,8 +160,8 @@ namespace
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing); BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
cc.enable_streaming(wsrep::streaming_context::row, 1); cc.enable_streaming(wsrep::streaming_context::row, 1);
} }
wsrep::fake_server_context sc; wsrep::mock_server_context sc;
wsrep::fake_client_context cc; wsrep::mock_client_context cc;
const wsrep::transaction_context& tc; const wsrep::transaction_context& tc;
}; };
@ -180,8 +180,8 @@ namespace
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing); BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
cc.enable_streaming(wsrep::streaming_context::bytes, 1); cc.enable_streaming(wsrep::streaming_context::bytes, 1);
} }
wsrep::fake_server_context sc; wsrep::mock_server_context sc;
wsrep::fake_client_context cc; wsrep::mock_client_context cc;
const wsrep::transaction_context& tc; const wsrep::transaction_context& tc;
}; };
@ -201,8 +201,8 @@ namespace
cc.enable_streaming(wsrep::streaming_context::row, 1); cc.enable_streaming(wsrep::streaming_context::row, 1);
} }
wsrep::fake_server_context sc; wsrep::mock_server_context sc;
wsrep::fake_client_context cc; wsrep::mock_client_context cc;
const wsrep::transaction_context& tc; const wsrep::transaction_context& tc;
}; };
} }

View File

@ -3,10 +3,10 @@
// //
#include "wsrep/transaction_context.hpp" #include "wsrep/transaction_context.hpp"
#include "fake_client_context.hpp" #include "mock_client_context.hpp"
int wsrep::fake_client_context::apply( int wsrep::mock_client_context::apply(
const wsrep::const_buffer& data __attribute__((unused))) const wsrep::const_buffer& data __attribute__((unused)))
{ {
@ -15,7 +15,7 @@ int wsrep::fake_client_context::apply(
return (fail_next_applying_ ? 1 : 0); return (fail_next_applying_ ? 1 : 0);
} }
int wsrep::fake_client_context::commit() int wsrep::mock_client_context::commit()
{ {
int ret(0); int ret(0);
if (do_2pc()) if (do_2pc())
@ -39,7 +39,7 @@ int wsrep::fake_client_context::commit()
return ret; return ret;
} }
int wsrep::fake_client_context::rollback() int wsrep::mock_client_context::rollback()
{ {
int ret(0); int ret(0);
if (transaction_.before_rollback()) if (transaction_.before_rollback())

View File

@ -13,10 +13,10 @@
namespace wsrep namespace wsrep
{ {
class fake_client_context : public wsrep::client_context class mock_client_context : public wsrep::client_context
{ {
public: public:
fake_client_context(wsrep::server_context& server_context, mock_client_context(wsrep::server_context& server_context,
const wsrep::client_id& id, const wsrep::client_id& id,
enum wsrep::client_context::mode mode, enum wsrep::client_context::mode mode,
bool is_autocommit = false, bool is_autocommit = false,
@ -37,7 +37,7 @@ namespace wsrep
, replays_() , replays_()
, aborts_() , aborts_()
{ } { }
~fake_client_context() ~mock_client_context()
{ {
if (transaction().active()) if (transaction().active())
{ {
@ -57,14 +57,9 @@ namespace wsrep
void will_replay(wsrep::transaction_context&) WSREP_OVERRIDE { } void will_replay(wsrep::transaction_context&) WSREP_OVERRIDE { }
int replay(wsrep::transaction_context& tc) WSREP_OVERRIDE int replay(wsrep::transaction_context& tc) WSREP_OVERRIDE
{ {
wsrep::client_applier_mode am(*this); int ret(provider().replay(tc.ws_handle(), this));
if (server_context().on_apply(
*this, tc.ws_handle(), tc.ws_meta(), wsrep::const_buffer()))
{
return 1;
}
++replays_; ++replays_;
return 0; return ret;
} }
void wait_for_replayers(wsrep::unique_lock<wsrep::mutex>& lock) void wait_for_replayers(wsrep::unique_lock<wsrep::mutex>& lock)
WSREP_OVERRIDE WSREP_OVERRIDE

View File

@ -15,12 +15,12 @@
namespace wsrep namespace wsrep
{ {
class fake_provider : public wsrep::provider class mock_provider : public wsrep::provider
{ {
public: public:
typedef std::map<wsrep::transaction_id, wsrep::seqno> bf_abort_map; typedef std::map<wsrep::transaction_id, wsrep::seqno> bf_abort_map;
fake_provider(wsrep::server_context& server_context) mock_provider(wsrep::server_context& server_context)
: provider(server_context) : provider(server_context)
, certify_result_() , certify_result_()
, commit_order_enter_result_() , commit_order_enter_result_()
@ -138,7 +138,15 @@ namespace wsrep
int release(wsrep::ws_handle&) int release(wsrep::ws_handle&)
{ return release_result_; } { return release_result_; }
int replay(wsrep::ws_handle&, void*) { ::abort(); /* not impl */} int replay(wsrep::ws_handle&, void* ctx)
{
wsrep::mock_client_context& cc(
*static_cast<wsrep::mock_client_context*>(ctx));
wsrep::client_applier_mode applier_mode(cc);
const wsrep::transaction_context& tc(cc.transaction());
return server_context_.on_apply(cc, tc.ws_handle(), tc.ws_meta(),
wsrep::const_buffer());
}
int sst_sent(const wsrep::gtid&, int) { return 0; } int sst_sent(const wsrep::gtid&, int) { return 0; }
int sst_received(const wsrep::gtid&, int) { return 0; } int sst_received(const wsrep::gtid&, int) { return 0; }
@ -148,7 +156,7 @@ namespace wsrep
return std::vector<status_variable>(); return std::vector<status_variable>();
} }
// Methods to modify fake state // Methods to modify mock state
/*! Inject BF abort event into the provider. /*! Inject BF abort event into the provider.
* *
* \param bf_seqno Aborter sequence number * \param bf_seqno Aborter sequence number

View File

@ -6,17 +6,17 @@
#define WSREP_FAKE_SERVER_CONTEXT_HPP #define WSREP_FAKE_SERVER_CONTEXT_HPP
#include "wsrep/server_context.hpp" #include "wsrep/server_context.hpp"
#include "fake_client_context.hpp" #include "mock_client_context.hpp"
#include "fake_provider.hpp" #include "mock_provider.hpp"
#include "wsrep/compiler.hpp" #include "wsrep/compiler.hpp"
namespace wsrep namespace wsrep
{ {
class fake_server_context : public wsrep::server_context class mock_server_context : public wsrep::server_context
{ {
public: public:
fake_server_context(const std::string& name, mock_server_context(const std::string& name,
const std::string& id, const std::string& id,
enum wsrep::server_context::rollback_mode rollback_mode) enum wsrep::server_context::rollback_mode rollback_mode)
: wsrep::server_context(mutex_, cond_, : wsrep::server_context(mutex_, cond_,
@ -26,16 +26,16 @@ namespace wsrep
, provider_(*this) , provider_(*this)
, last_client_id_(0) , last_client_id_(0)
{ } { }
wsrep::fake_provider& provider() const wsrep::mock_provider& provider() const
{ return provider_; } { return provider_; }
wsrep::client_context* local_client_context() wsrep::client_context* local_client_context()
{ {
return new wsrep::fake_client_context(*this, ++last_client_id_, return new wsrep::mock_client_context(*this, ++last_client_id_,
wsrep::client_context::m_local); wsrep::client_context::m_local);
} }
wsrep::client_context* streaming_applier_client_context() wsrep::client_context* streaming_applier_client_context()
{ {
return new wsrep::fake_client_context( return new wsrep::mock_client_context(
*this, ++last_client_id_, wsrep::client_context::m_applier); *this, ++last_client_id_, wsrep::client_context::m_applier);
} }
void log_dummy_write_set(wsrep::client_context&, const wsrep::ws_meta&) void log_dummy_write_set(wsrep::client_context&, const wsrep::ws_meta&)
@ -65,7 +65,7 @@ namespace wsrep
private: private:
wsrep::default_mutex mutex_; wsrep::default_mutex mutex_;
wsrep::default_condition_variable cond_; wsrep::default_condition_variable cond_;
mutable wsrep::fake_provider provider_; mutable wsrep::mock_provider provider_;
unsigned long long last_client_id_; unsigned long long last_client_id_;
}; };
} }

View File

@ -2,7 +2,7 @@
// Copyright (C) 2018 Codership Oy <info@codership.com> // Copyright (C) 2018 Codership Oy <info@codership.com>
// //
#include "fake_server_context.hpp" #include "mock_server_context.hpp"
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
@ -25,8 +25,8 @@ namespace
wsrep::provider::flag::commit) wsrep::provider::flag::commit)
{ {
} }
wsrep::fake_server_context sc; wsrep::mock_server_context sc;
wsrep::fake_client_context cc; wsrep::mock_client_context cc;
wsrep::ws_handle ws_handle; wsrep::ws_handle ws_handle;
wsrep::ws_meta ws_meta; wsrep::ws_meta ws_meta;
}; };
@ -85,9 +85,9 @@ BOOST_FIXTURE_TEST_CASE(server_context_applying_2pc_rollback,
BOOST_AUTO_TEST_CASE(server_context_streaming) BOOST_AUTO_TEST_CASE(server_context_streaming)
{ {
wsrep::fake_server_context sc("s1", "s1", wsrep::mock_server_context sc("s1", "s1",
wsrep::server_context::rm_sync); wsrep::server_context::rm_sync);
wsrep::fake_client_context cc(sc, wsrep::mock_client_context cc(sc,
wsrep::client_id(1), wsrep::client_id(1),
wsrep::client_context::m_applier, wsrep::client_context::m_applier,
false); false);

View File

@ -4,7 +4,7 @@
#include "test_utils.hpp" #include "test_utils.hpp"
#include "wsrep/client_context.hpp" #include "wsrep/client_context.hpp"
#include "fake_server_context.hpp" #include "mock_server_context.hpp"
// Simple BF abort method to BF abort unordered transasctions // Simple BF abort method to BF abort unordered transasctions
@ -22,7 +22,7 @@ void wsrep_test::bf_abort_ordered(wsrep::client_context& cc)
cc.bf_abort(lock, wsrep::seqno(0)); cc.bf_abort(lock, wsrep::seqno(0));
} }
// BF abort method to abort transactions via provider // BF abort method to abort transactions via provider
void wsrep_test::bf_abort_provider(wsrep::fake_server_context& sc, void wsrep_test::bf_abort_provider(wsrep::mock_server_context& sc,
const wsrep::transaction_context& tc, const wsrep::transaction_context& tc,
wsrep::seqno bf_seqno) wsrep::seqno bf_seqno)
{ {

View File

@ -6,7 +6,7 @@
namespace wsrep namespace wsrep
{ {
class client_context; class client_context;
class fake_server_context; class mock_server_context;
} }
#include "wsrep/transaction_context.hpp" #include "wsrep/transaction_context.hpp"
@ -25,7 +25,7 @@ namespace wsrep_test
void bf_abort_ordered(wsrep::client_context& cc); void bf_abort_ordered(wsrep::client_context& cc);
// BF abort method to abort transactions via provider // BF abort method to abort transactions via provider
void bf_abort_provider(wsrep::fake_server_context& sc, void bf_abort_provider(wsrep::mock_server_context& sc,
const wsrep::transaction_context& tc, const wsrep::transaction_context& tc,
wsrep::seqno bf_seqno); wsrep::seqno bf_seqno);

View File

@ -158,7 +158,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_bf_during_before_commit_uncertified, T, transaction_context_1pc_bf_during_before_commit_uncertified, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_server_context& sc(T::sc); wsrep::mock_server_context& sc(T::sc);
wsrep::client_context& cc(T::cc); wsrep::client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
@ -198,7 +198,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_bf_during_commit_wait_for_replayers, T, transaction_context_1pc_bf_during_commit_wait_for_replayers, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_client_context& cc(T::cc); wsrep::mock_client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
// Start a new transaction with ID 1 // Start a new transaction with ID 1
@ -236,7 +236,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_error_during_prepare_data, T, transaction_context_1pc_error_during_prepare_data, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_client_context& cc(T::cc); wsrep::mock_client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
// Start a new transaction with ID 1 // Start a new transaction with ID 1
@ -275,7 +275,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_killed_before_certify, T, transaction_context_1pc_killed_before_certify, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_client_context& cc(T::cc); wsrep::mock_client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
// Start a new transaction with ID 1 // Start a new transaction with ID 1
@ -317,8 +317,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_bf_during_before_commit_certified, T, transaction_context_1pc_bf_during_before_commit_certified, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_server_context& sc(T::sc); wsrep::mock_server_context& sc(T::sc);
wsrep::fake_client_context& cc(T::cc); wsrep::mock_client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
// Start a new transaction with ID 1 // Start a new transaction with ID 1
@ -360,8 +360,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_bf_before_unordered_cert_failure, T, transaction_context_1pc_bf_before_unordered_cert_failure, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_server_context& sc(T::sc); wsrep::mock_server_context& sc(T::sc);
wsrep::fake_client_context& cc(T::cc); wsrep::mock_client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
cc.start_transaction(1); cc.start_transaction(1);
@ -369,7 +369,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
BOOST_REQUIRE(tc.id() == wsrep::transaction_id(1)); BOOST_REQUIRE(tc.id() == wsrep::transaction_id(1));
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing); BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
cc.sync_point_enabled_ = "wsrep_before_certification"; cc.sync_point_enabled_ = "wsrep_before_certification";
cc.sync_point_action_ = wsrep::fake_client_context::spa_bf_abort_unordered; cc.sync_point_action_ = wsrep::mock_client_context::spa_bf_abort_unordered;
sc.provider().certify_result_ = wsrep::provider::error_certification_failed; sc.provider().certify_result_ = wsrep::provider::error_certification_failed;
BOOST_REQUIRE(cc.before_commit()); BOOST_REQUIRE(cc.before_commit());
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_cert_failed); BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_cert_failed);
@ -393,7 +393,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_warning_error_from_certify, T, transaction_context_1pc_warning_error_from_certify, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_server_context& sc(T::sc); wsrep::mock_server_context& sc(T::sc);
wsrep::client_context& cc(T::cc); wsrep::client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
@ -434,7 +434,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_transaction_missing_from_certify, T, transaction_context_1pc_transaction_missing_from_certify, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_server_context& sc(T::sc); wsrep::mock_server_context& sc(T::sc);
wsrep::client_context& cc(T::cc); wsrep::client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
@ -475,7 +475,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_size_exceeded_from_certify, T, transaction_context_1pc_size_exceeded_from_certify, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_server_context& sc(T::sc); wsrep::mock_server_context& sc(T::sc);
wsrep::client_context& cc(T::cc); wsrep::client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
@ -516,7 +516,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_connection_failed_from_certify, T, transaction_context_1pc_connection_failed_from_certify, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_server_context& sc(T::sc); wsrep::mock_server_context& sc(T::sc);
wsrep::client_context& cc(T::cc); wsrep::client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
@ -557,7 +557,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_no_allowed_from_certify, T, transaction_context_1pc_no_allowed_from_certify, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_server_context& sc(T::sc); wsrep::mock_server_context& sc(T::sc);
wsrep::client_context& cc(T::cc); wsrep::client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
@ -598,8 +598,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_fatal_from_certify, T, transaction_context_1pc_fatal_from_certify, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_server_context& sc(T::sc); wsrep::mock_server_context& sc(T::sc);
wsrep::fake_client_context& cc(T::cc); wsrep::mock_client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
// Start a new transaction with ID 1 // Start a new transaction with ID 1
@ -640,8 +640,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_unknown_from_certify, T, transaction_context_1pc_unknown_from_certify, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
wsrep::fake_server_context& sc(T::sc); wsrep::mock_server_context& sc(T::sc);
wsrep::fake_client_context& cc(T::cc); wsrep::mock_client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
// Start a new transaction with ID 1 // Start a new transaction with ID 1
@ -682,8 +682,8 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
transaction_context_1pc_bf_abort_before_certify_regain_lock, T, transaction_context_1pc_bf_abort_before_certify_regain_lock, T,
replicating_fixtures, T) replicating_fixtures, T)
{ {
// wsrep::fake_server_context& sc(T::sc); // wsrep::mock_server_context& sc(T::sc);
wsrep::fake_client_context& cc(T::cc); wsrep::mock_client_context& cc(T::cc);
const wsrep::transaction_context& tc(T::tc); const wsrep::transaction_context& tc(T::tc);
// Start a new transaction with ID 1 // Start a new transaction with ID 1
@ -693,7 +693,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing); BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_executing);
cc.sync_point_enabled_ = "wsrep_after_certification"; cc.sync_point_enabled_ = "wsrep_after_certification";
cc.sync_point_action_ = wsrep::fake_client_context::spa_bf_abort_ordered; cc.sync_point_action_ = wsrep::mock_client_context::spa_bf_abort_ordered;
// Run before commit // Run before commit
BOOST_REQUIRE(cc.before_commit()); BOOST_REQUIRE(cc.before_commit());
BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_replay); BOOST_REQUIRE(tc.state() == wsrep::transaction_context::s_must_replay);