Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IT: adjust DCExecutionProfileTests to tablets #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions tests/src/integration/tests/test_exec_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ class ExecutionProfileTest : public Integration {
is_beta_protocol_ = false; // Issue with beta protocol v5 and functions on Cassandra v3.10.0+
}

virtual void set_insert_statement() {
// By default, use LWT statement. These are OK for single dc tests.
// LWT is needed for SerialConsistency test.
insert_ = Statement(format_string("INSERT INTO %s (key, value) VALUES (?, ?) IF NOT EXISTS",
table_name_.c_str()),
2);
insert_.bind<Text>(0, Text(test_name_));
insert_.bind<Integer>(1, Integer(1000));
}

void SetUp() {
// Calculate the total number of nodes being used
total_nodes_ = number_dc1_nodes_ + number_dc2_nodes_;
Expand Down Expand Up @@ -71,11 +81,7 @@ class ExecutionProfileTest : public Integration {
format_string("CREATE TABLE %s (key text PRIMARY KEY, value int)", table_name_.c_str()));

// Create the insert statement for later use
insert_ = Statement(format_string("INSERT INTO %s (key, value) VALUES (?, ?) IF NOT EXISTS",
table_name_.c_str()),
2);
insert_.bind<Text>(0, Text(test_name_));
insert_.bind<Integer>(1, Integer(1000));
set_insert_statement();

// Insert an expected value (if not the serial consistency test)
session_.execute(insert_);
Expand Down Expand Up @@ -185,6 +191,17 @@ class DCExecutionProfileTest : public ExecutionProfileTest {
public:
DCExecutionProfileTest() { number_dc2_nodes_ = 1; }

void set_insert_statement() {
// Create the insert statement for later use
// For multi-dc tests do not use LWT statements as it causes following error:
// Cannot use LightWeight Transactions for table ...
insert_ = Statement(format_string("INSERT INTO %s (key, value) VALUES (?, ?)",
table_name_.c_str()),
2);
insert_.bind<Text>(0, Text(test_name_));
insert_.bind<Integer>(1, Integer(1000));
}

void SetUp() {
// Create the execution profiles for the test cases
profiles_["dc_aware"] = ExecutionProfile::build()
Expand Down