Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CBD-80 Fix to sporadic unit test failures on Linux

Add test_setup func and wait_for_warmup_complete to ensure that
loading of ep_engine completes before running test case.
Bulk of test failures on Linux were due to incomplete warmup of
ep_engine prior to running test cases.

Change-Id: I2db65c23c3754743323cc2eb07e801a106409e67
Reviewed-on: http://review.couchbase.org/15920
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
  • Loading branch information...
commit 1553f495275591c6174f7d61e0533b3fa337a374 1 parent 5008c42
@jinlim jinlim authored chiyoung committed
Showing with 458 additions and 355 deletions.
  1. +458 −355 ep_testsuite.cc
View
813 ep_testsuite.cc
@@ -194,6 +194,37 @@ static inline void decayingSleep(useconds_t *sleepTime) {
*sleepTime = std::min(*sleepTime << 1, maxSleepTime);
}
+static void add_stats(const char *key, const uint16_t klen,
+ const char *val, const uint32_t vlen,
+ const void *cookie) {
+ (void)cookie;
+ std::string k(key, klen);
+ std::string v(val, vlen);
+
+ if (dump_stats) {
+ std::cout << "stat[" << k << "] = " << v << std::endl;
+ }
+
+ vals[k] = v;
+}
+
+static bool wait_for_warmup_complete(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1) {
+ while (h1->get_stats(h, NULL, "warmup", 6, add_stats) == ENGINE_SUCCESS) {
+ useconds_t sleepTime = 128;
+ std::string s = vals["ep_warmup_thread"];
+ if (strcmp(s.c_str(), "complete") == 0) {
+ break;
+ }
+ decayingSleep(&sleepTime);
+ vals.clear();
+ }
+ return true;
+}
+
+static bool test_setup(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1) {
+ return wait_for_warmup_complete(h, h1);
+}
+
static ENGINE_ERROR_CODE storeCasVb11(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1,
const void *cookie,
ENGINE_STORE_OPERATION op,
@@ -319,20 +350,6 @@ static enum test_result check_key_value(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1,
return SUCCESS;
}
-static void add_stats(const char *key, const uint16_t klen,
- const char *val, const uint32_t vlen,
- const void *cookie) {
- (void)cookie;
- std::string k(key, klen);
- std::string v(val, vlen);
-
- if (dump_stats) {
- std::cout << "stat[" << k << "] = " << v << std::endl;
- }
-
- vals[k] = v;
-}
-
static bool add_response(const void *key, uint16_t keylen,
const void *ext, uint8_t extlen,
const void *body, uint32_t bodylen,
@@ -870,6 +887,7 @@ static void wait_for_persisted_value(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1,
item *i = NULL;
int commitNum = get_int_stat(h, h1, "ep_commit_num");
+
check(store(h, h1, NULL, OPERATION_SET, key, val, &i, 0, vbucketId) == ENGINE_SUCCESS,
"Failed to store an item.");
@@ -1351,8 +1369,10 @@ static enum test_result test_flush_disabled(ENGINE_HANDLE *h,
testHarness.engine_path,
config.c_str(),
true, false);
+ wait_for_warmup_complete(h, h1);
check(h1->flush(h, NULL, 0) == ENGINE_SUCCESS, "Flush should be enabled");
+
//expect missing key
check(ENGINE_KEY_ENOENT == verify_key(h, h1, "key"), "Expected missing key");
@@ -1453,6 +1473,7 @@ static enum test_result test_flush_restart(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h
testHarness.engine_path,
testHarness.get_current_testcase()->cfg,
true, false);
+ wait_for_warmup_complete(h, h1);
// Read value from disk.
check_key_value(h, h1, "key", "somevalue", 9);
@@ -1470,6 +1491,7 @@ static enum test_result test_flush_restart(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h
testHarness.engine_path,
testHarness.get_current_testcase()->cfg,
true, false);
+ wait_for_warmup_complete(h, h1);
check(store(h, h1, NULL, OPERATION_SET, "key3", "somevalue", &i) == ENGINE_SUCCESS,
"Failed post-flush, post-restart set.");
@@ -1496,6 +1518,7 @@ static enum test_result test_flush_multiv_restart(ENGINE_HANDLE *h, ENGINE_HANDL
testHarness.engine_path,
testHarness.get_current_testcase()->cfg,
true, false);
+ wait_for_warmup_complete(h, h1);
// Read value from disk.
check_key_value(h, h1, "key", "somevalue", 9);
@@ -1509,6 +1532,7 @@ static enum test_result test_flush_multiv_restart(ENGINE_HANDLE *h, ENGINE_HANDL
testHarness.engine_path,
testHarness.get_current_testcase()->cfg,
true, false);
+ wait_for_warmup_complete(h, h1);
// Read value again, should not be there.
check(ENGINE_KEY_ENOENT == verify_key(h, h1, "key"), "Expected missing key");
@@ -1763,6 +1787,7 @@ static enum test_result test_delete_set(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1)
testHarness.engine_path,
testHarness.get_current_testcase()->cfg,
true, false);
+ wait_for_warmup_complete(h, h1);
check(ENGINE_KEY_ENOENT == verify_key(h, h1, "key"), "Expected missing key");
@@ -2600,7 +2625,6 @@ static enum test_result test_memory_limit(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1
check(store(h, h1, NULL, OPERATION_SET, "key2", "somevalue2", &i) == ENGINE_SUCCESS,
"should have succeded on the last set");
check_key_value(h, h1, "key2", "somevalue2", 10);
-
return SUCCESS;
}
@@ -3730,7 +3754,7 @@ static enum test_result test_checkpoint_collapse(ENGINE_HANDLE *h, ENGINE_HANDLE
"Stop Persistence Command Failed");
item* itm;
- for (int i = 0; i < 20000; i++) {
+ for (int i = 0; i < 5000; i++) {
char key[9];
sprintf(key, "key%d", i);
check(store(h, h1, NULL, OPERATION_SET, key, "value", &itm, 0, 0)
@@ -3738,9 +3762,9 @@ static enum test_result test_checkpoint_collapse(ENGINE_HANDLE *h, ENGINE_HANDLE
}
wait_for_stat_to_be(h, h1, "vb_0:num_checkpoints", 2, "checkpoint");
- wait_for_stat_to_be(h, h1, "vb_0:num_checkpoint_items", 20003, "checkpoint");
+ wait_for_stat_to_be(h, h1, "vb_0:num_checkpoint_items", 5003, "checkpoint");
- for (int i = 0; i < 15000; i++) {
+ for (int i = 0; i < 3000; i++) {
char key[9];
sprintf(key, "key%d", i);
check(h1->remove(h, NULL, key, strlen(key), 0, 0) == ENGINE_SUCCESS,
@@ -3748,7 +3772,7 @@ static enum test_result test_checkpoint_collapse(ENGINE_HANDLE *h, ENGINE_HANDLE
}
wait_for_stat_to_be(h, h1, "vb_0:num_checkpoints", 2, "checkpoint");
- wait_for_stat_to_be(h, h1, "vb_0:num_checkpoint_items", 25003, "checkpoint");
+ wait_for_stat_to_be(h, h1, "vb_0:num_checkpoint_items", 6003, "checkpoint");
return SUCCESS;
}
@@ -3973,16 +3997,7 @@ static enum test_result test_warmup_stats(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1
testHarness.get_current_testcase()->cfg,
true, false);
- useconds_t sleepTime = 128;
- while (h1->get_stats(h, NULL, "warmup", 6, add_stats) == ENGINE_SUCCESS) {
- std::string s = vals["ep_warmup_thread"];
- if (strcmp(s.c_str(), "complete") == 0) {
- break;
- }
- decayingSleep(&sleepTime);
- vals.clear();
- }
-
+ wait_for_warmup_complete(h, h1);
check(vals.find("ep_warmup_thread") != vals.end(), "Found no ep_warmup_thread");
check(vals.find("ep_warmup_count") != vals.end(), "Found no ep_warmup_count");
check(vals.find("ep_warmup_dups") != vals.end(), "Found no ep_warmup_dups");
@@ -4149,16 +4164,7 @@ static enum test_result test_mb5172(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1) {
testHarness.get_current_testcase()->cfg,
true, false);
- useconds_t sleepTime = 50;
- while (h1->get_stats(h, NULL, "warmup", 6, add_stats) == ENGINE_SUCCESS) {
- std::string s = vals["ep_warmup_thread"];
- if (strcmp(s.c_str(), "complete") == 0) {
- break;
- }
- decayingSleep(&sleepTime);
- vals.clear();
- }
-
+ wait_for_warmup_complete(h, h1);
check(get_int_stat(h, h1, "ep_num_non_resident") == 0,
"Expected all items to be resident");
return SUCCESS;
@@ -4646,6 +4652,7 @@ static enum test_result test_kill9_bucket(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1
testHarness.engine_path,
testHarness.get_current_testcase()->cfg,
true, true);
+ wait_for_warmup_complete(h, h1);
keys.clear();
for (int j = 0; j < 2000; ++j) {
@@ -6434,416 +6441,501 @@ engine_test_t* get_tests(void) {
NULL, prepare, cleanup, BACKEND_ALL),
TestCase("test init failure", test_init_fail, NULL, teardown,
NULL, prepare, cleanup, BACKEND_SQLITE),
- TestCase("test total memory limit", test_memory_limit, NULL, teardown,
+ TestCase("test total memory limit", test_memory_limit,
+ test_setup, teardown,
"max_size=4096;ht_locks=1;ht_size=3;chk_remover_stime=1;chk_period=60;mutation_mem_threshold=0.9",
prepare, cleanup, BACKEND_ALL),
- TestCase("test max_size changes", test_max_size_settings, NULL,
- teardown, "max_size=1000;ht_locks=1;ht_size=3", prepare,
+ TestCase("test max_size changes", test_max_size_settings,
+ test_setup, teardown,
+ "max_size=1000;ht_locks=1;ht_size=3", prepare,
cleanup, BACKEND_ALL),
- TestCase("test whitespace dbname", test_whitespace_db, NULL, teardown,
+ TestCase("test whitespace dbname", test_whitespace_db,
+ test_setup, teardown,
"dbname=" WHITESPACE_DB ";ht_locks=1;ht_size=3",
prepare, cleanup, BACKEND_ALL),
- TestCase("test db shards", test_db_shards, NULL, teardown,
- "db_shards=5;db_strategy=multiDB", prepare, cleanup,
+ TestCase("test db shards", test_db_shards, test_setup,
+ teardown, "db_shards=5;db_strategy=multiDB", prepare, cleanup,
BACKEND_SQLITE),
TestCase("test single db strategy", test_single_db_strategy,
- NULL, teardown, "db_strategy=singleDB", prepare, cleanup,
- BACKEND_SQLITE),
- TestCase("test single in-memory db strategy", test_single_db_strategy,
- NULL, teardown, "db_strategy=singleDB;dbname=:memory:",
+ test_setup, teardown, "db_strategy=singleDB",
prepare, cleanup, BACKEND_SQLITE),
- TestCase("get miss", test_get_miss, NULL, teardown, NULL, prepare,
- cleanup, BACKEND_ALL),
- TestCase("set", test_set, NULL, teardown, NULL, prepare, cleanup,
- BACKEND_ALL),
- TestCase("concurrent set", test_conc_set, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("set+get hit", test_set_get_hit, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("set+get hit with max_txn_size", test_set_get_hit, NULL,
- teardown,
+ TestCase("test single in-memory db strategy", test_single_db_strategy,
+ test_setup, teardown,
+ "db_strategy=singleDB;dbname=:memory:", prepare, cleanup,
+ BACKEND_SQLITE),
+ TestCase("get miss", test_get_miss, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("set", test_set, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("concurrent set", test_conc_set, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("set+get hit", test_set_get_hit, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("set+get hit with max_txn_size", test_set_get_hit,
+ test_setup, teardown,
"ht_locks=1;ht_size=3;max_txn_size=10", prepare, cleanup,
BACKEND_ALL),
- TestCase("getl", test_getl, NULL, teardown, NULL, prepare, cleanup,
- BACKEND_ALL),
- TestCase("unl", test_unl, NULL, teardown, NULL, prepare, cleanup,
- BACKEND_ALL),
- TestCase("set+get hit (bin)", test_set_get_hit_bin, NULL, teardown,
+ TestCase("getl", test_getl, test_setup, teardown,
NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("set+change flags", test_set_change_flags, NULL, teardown,
+ TestCase("unl", test_unl, test_setup, teardown,
NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("add", test_add, NULL, teardown, NULL, prepare, cleanup,
- BACKEND_ALL),
- TestCase("add+add(same cas)", test_add_add_with_cas, NULL,
- teardown, NULL, prepare, cleanup,
- BACKEND_ALL),
- TestCase("cas", test_cas, NULL, teardown, NULL, prepare, cleanup,
+ TestCase("set+get hit (bin)", test_set_get_hit_bin,
+ test_setup, teardown, NULL, prepare, cleanup,
BACKEND_ALL),
- TestCase("append", test_append, NULL, teardown, NULL, prepare, cleanup,
- BACKEND_ALL),
- TestCase("prepend", test_prepend, NULL, teardown, NULL, prepare,
- cleanup, BACKEND_ALL),
- TestCase("replace", test_replace, NULL, teardown, NULL, prepare,
- cleanup, BACKEND_ALL),
- TestCase("incr miss", test_incr_miss, NULL, teardown, NULL, prepare,
- cleanup, BACKEND_ALL),
- TestCase("incr", test_incr, NULL, teardown, NULL, prepare, cleanup,
+ TestCase("set+change flags", test_set_change_flags,
+ test_setup, teardown, NULL, prepare, cleanup,
BACKEND_ALL),
- TestCase("incr with default", test_incr_default, NULL, teardown, NULL,
+ TestCase("add", test_add, test_setup, teardown, NULL,
prepare, cleanup, BACKEND_ALL),
- TestCase("incr expiry", test_bug2799, NULL, teardown, NULL, prepare,
- cleanup, BACKEND_ALL),
- TestCase("test touch", test_touch, NULL, teardown, NULL, prepare,
- cleanup, BACKEND_ALL),
- TestCase("test gat", test_gat, NULL, teardown, NULL, prepare, cleanup,
+ TestCase("add+add(same cas)", test_add_add_with_cas,
+ test_setup, teardown, NULL, prepare, cleanup,
BACKEND_ALL),
- TestCase("test gatq", test_gatq, NULL, teardown, NULL, prepare,
- cleanup, BACKEND_ALL),
- TestCase("delete", test_delete, NULL, teardown, NULL, prepare, cleanup,
- BACKEND_ALL),
- TestCase("set/delete", test_set_delete, NULL, teardown, NULL,
+ TestCase("cas", test_cas, test_setup, teardown, NULL,
prepare, cleanup, BACKEND_ALL),
- TestCase("set/delete (invalid cas)", test_set_delete_invalid_cas,
- NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("delete/set/delete", test_delete_set, NULL, teardown, NULL,
+ TestCase("append", test_append, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("prepend", test_prepend, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("replace", test_replace, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("incr miss", test_incr_miss, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("incr", test_incr, test_setup, teardown, NULL,
prepare, cleanup, BACKEND_ALL),
+ TestCase("incr with default", test_incr_default,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("incr expiry", test_bug2799, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("test touch", test_touch, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("test gat", test_gat, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("test gatq", test_gatq, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("delete", test_delete, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("set/delete", test_set_delete, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("set/delete (invalid cas)", test_set_delete_invalid_cas,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("delete/set/delete", test_delete_set, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
TestCase("retain rowid over a soft delete", test_bug2509,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
TestCase("vbucket deletion doesn't affect new data", test_bug2761,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_SQLITE),
- TestCase("start transaction failure handling", test_bug2830, NULL,
- teardown,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_SQLITE),
+ TestCase("start transaction failure handling", test_bug2830,
+ test_setup, teardown,
"db_shards=1;ht_size=13;ht_locks=7;db_strategy=multiDB",
prepare, cleanup, BACKEND_SQLITE),
- TestCase("non-resident decrementers", test_mb3169, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("resident ratio after warmup", test_mb5172, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("flush", test_flush, NULL, teardown, NULL, prepare, cleanup,
+ TestCase("non-resident decrementers", test_mb3169,
+ test_setup, teardown, NULL, prepare, cleanup,
BACKEND_ALL),
- TestCase("flush with stats", test_flush_stats, NULL, teardown,
- "flushall_enabled=true;chk_remover_stime=1;chk_period=60", prepare, cleanup,
+ TestCase("resident ratio after warmup", test_mb5172,
+ test_setup, teardown, NULL, prepare, cleanup,
BACKEND_ALL),
- TestCase("flush multi vbuckets", test_flush_multiv, NULL, teardown,
+ TestCase("flush", test_flush, test_setup, teardown,
NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("flush multi vbuckets single mt", test_flush_multiv, NULL,
+ TestCase("flush with stats", test_flush_stats, test_setup,
teardown,
- "flushall_enabled=true;db_strategy=singleMTDB;max_vbuckets=16;"
- "ht_size=7;ht_locks=3",
+ "flushall_enabled=true;chk_remover_stime=1;chk_period=60",
prepare, cleanup, BACKEND_ALL),
- TestCase("flush multi vbuckets multi mt", test_flush_multiv, NULL,
- teardown,
+ TestCase("flush multi vbuckets", test_flush_multiv,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("flush multi vbuckets single mt", test_flush_multiv,
+ test_setup, teardown,
+ "flushall_enabled=true;db_strategy=singleMTDB;max_vbuckets=16;"
+ "ht_size=7;ht_locks=3", prepare, cleanup, BACKEND_ALL),
+ TestCase("flush multi vbuckets multi mt", test_flush_multiv,
+ test_setup, teardown,
"flushall_enabled=true;db_strategy=multiMTDB;max_vbuckets=16;"
- "ht_size=7;ht_locks=3",
- prepare, cleanup, BACKEND_ALL),
- TestCase("flush multi vbuckets multi mt vb", test_flush_multiv, NULL,
- teardown,
+ "ht_size=7;ht_locks=3", prepare, cleanup, BACKEND_ALL),
+ TestCase("flush multi vbuckets multi mt vb", test_flush_multiv,
+ test_setup, teardown,
"flushall_enabled=true;db_strategy=multiMTVBDB;max_vbuckets=16;"
- "ht_size=7;ht_locks=3",
- prepare, cleanup, BACKEND_ALL),
- TestCase("flush_disabled", test_flush_disabled, NULL,
+ "ht_size=7;ht_locks=3", prepare, cleanup, BACKEND_ALL),
+ TestCase("flush_disabled", test_flush_disabled, test_setup,
teardown,
"flushall_enabled=false;db_strategy=multiMTVBDB;max_vbuckets=16;"
- "ht_size=7;ht_locks=3",
- prepare, cleanup, BACKEND_ALL),
- TestCase("expiry", test_expiry, NULL, teardown, NULL, prepare, cleanup,
+ "ht_size=7;ht_locks=3", prepare, cleanup, BACKEND_ALL),
+ TestCase("expiry", test_expiry, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("expiry_loader", test_expiry_loader, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("expiry_flush", test_expiry_flush, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("expiry_duplicate_warmup", test_bug3454, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("expiry_no_items_warmup", test_bug3522, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("replica read", test_get_replica, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("replica read: invalid state - active",
+ test_get_replica_active_state,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("replica read: invalid state - pending",
+ test_get_replica_pending_state,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("replica read: invalid state - dead",
+ test_get_replica_dead_state,
+ test_setup, teardown, NULL, prepare, cleanup,
BACKEND_ALL),
- TestCase("expiry_loader", test_expiry_loader, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("expiry_flush", test_expiry_flush, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("expiry_duplicate_warmup", test_bug3454, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("expiry_no_items_warmup", test_bug3522, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("replica read", test_get_replica, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("replica read: invalid state - active", test_get_replica_active_state,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("replica read: invalid state - pending", test_get_replica_pending_state,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("replica read: invalid state - dead", test_get_replica_dead_state,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
TestCase("replica read: invalid key", test_get_replica_invalid_key,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
- // Stats tests
- TestCase("stats", test_stats, NULL, teardown, NULL, prepare, cleanup,
+ test_setup, teardown, NULL, prepare, cleanup,
BACKEND_ALL),
- TestCase("io stats", test_io_stats, NULL, teardown, NULL, prepare,
- cleanup, BACKEND_ALL),
- TestCase("bg stats", test_bg_stats, NULL, teardown, NULL, prepare,
- cleanup, BACKEND_ALL),
- TestCase("mem stats", test_mem_stats, NULL, teardown,
+ // Stats tests
+ TestCase("stats", test_stats, test_setup, teardown, NULL,
+ prepare, cleanup, BACKEND_ALL),
+ TestCase("io stats", test_io_stats, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("bg stats", test_bg_stats, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("mem stats", test_mem_stats, test_setup, teardown,
"chk_remover_stime=1;chk_period=60", prepare, cleanup,
BACKEND_ALL),
- TestCase("stats key", test_key_stats, NULL, teardown, NULL, prepare,
- cleanup, BACKEND_ALL),
- TestCase("stats vkey", test_vkey_stats, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("warmup stats", test_warmup_stats, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("stats curr_items", test_curr_items, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
+ TestCase("stats key", test_key_stats, test_setup, teardown,
+ NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("stats vkey", test_vkey_stats, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("warmup stats", test_warmup_stats, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("stats curr_items", test_curr_items, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
// eviction
- TestCase("value eviction", test_value_eviction, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- // duplicate items on disk
- TestCase("duplicate items on disk", test_duplicate_items_disk, NULL,
+ TestCase("value eviction", test_value_eviction, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ // duplicate items on disk
+ TestCase("duplicate items on disk", test_duplicate_items_disk,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
// tap tests
- TestCase("set tap param", test_set_tap_param, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
+ TestCase("set tap param", test_set_tap_param, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
TestCase("tap_noop_interval default config",
test_tap_noop_config_default,
- NULL, teardown, NULL , prepare, cleanup, BACKEND_ALL),
- TestCase("tap_noop_interval config", test_tap_noop_config, NULL,
- teardown,
+ test_setup, teardown, NULL , prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("tap_noop_interval config", test_tap_noop_config,
+ test_setup, teardown,
"tap_noop_interval=10", prepare, cleanup, BACKEND_ALL),
- TestCase("tap receiver mutation", test_tap_rcvr_mutate, NULL, teardown,
+ TestCase("tap receiver mutation", test_tap_rcvr_mutate,
+ test_setup, teardown,
NULL, prepare, cleanup, BACKEND_ALL),
TestCase("tap receiver checkpoint start/end", test_tap_rcvr_checkpoint,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
TestCase("tap receiver mutation (dead)", test_tap_rcvr_mutate_dead,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
TestCase("tap receiver mutation (pending)",
test_tap_rcvr_mutate_pending,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
TestCase("tap receiver mutation (replica)",
test_tap_rcvr_mutate_replica,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("tap receiver delete", test_tap_rcvr_delete, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("tap receiver delete", test_tap_rcvr_delete,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
TestCase("tap receiver delete (dead)", test_tap_rcvr_delete_dead,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
TestCase("tap receiver delete (pending)", test_tap_rcvr_delete_pending,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
TestCase("tap receiver delete (replica)", test_tap_rcvr_delete_replica,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("tap stream", test_tap_stream, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("tap agg stats", test_tap_agg_stats, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("tap takeover (with concurrent mutations)", test_tap_takeover, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("tap filter stream", test_tap_filter_stream, NULL, teardown,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("tap stream", test_tap_stream, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("tap agg stats", test_tap_agg_stats, test_setup,
+ teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("tap takeover (with concurrent mutations)", test_tap_takeover,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("tap filter stream", test_tap_filter_stream,
+ test_setup, teardown,
"tap_keepalive=100;ht_size=129;ht_locks=3", prepare, cleanup,
BACKEND_ALL),
- TestCase("tap default config", test_tap_default_config, NULL,
- teardown, NULL , prepare, cleanup, BACKEND_ALL),
- TestCase("tap config", test_tap_config, NULL, teardown,
+ TestCase("tap default config", test_tap_default_config,
+ test_setup, teardown, NULL , prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("tap config", test_tap_config, test_setup,
+ teardown,
"tap_backoff_period=0.05;tap_ack_interval=10;tap_ack_window_size=2;tap_ack_grace_period=10",
prepare, cleanup, BACKEND_ALL),
- TestCase("tap acks stream", test_tap_ack_stream, NULL, teardown,
+ TestCase("tap acks stream", test_tap_ack_stream,
+ test_setup, teardown,
"tap_keepalive=100;ht_size=129;ht_locks=3;tap_backoff_period=0.05;chk_max_items=500",
prepare, cleanup, BACKEND_ALL),
TestCase("tap implicit acks stream", test_tap_implicit_ack_stream,
- NULL, teardown,
+ test_setup, teardown,
"tap_keepalive=100;ht_size=129;ht_locks=3;tap_backoff_period=0.05;tap_ack_initial_sequence_number=4294967290;chk_max_items=500",
prepare, cleanup, BACKEND_ALL),
- TestCase("tap notify", test_tap_notify, NULL, teardown,
- "max_size=1048576", prepare, cleanup, BACKEND_ALL),
+ TestCase("tap notify", test_tap_notify, test_setup,
+ teardown, "max_size=1048576", prepare, cleanup, BACKEND_ALL),
// restart tests
- TestCase("test restart", test_restart, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("set+get+restart+hit (bin)", test_restart_bin_val, NULL,
+ TestCase("test restart", test_restart, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("flush+restart", test_flush_restart, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("flush multiv+restart", test_flush_multiv_restart, NULL,
+ TestCase("set+get+restart+hit (bin)", test_restart_bin_val,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("flush+restart", test_flush_restart, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("test kill -9 bucket", test_kill9_bucket, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("flush multiv+restart", test_flush_multiv_restart,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("test kill -9 bucket", test_kill9_bucket,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
TestCase("test restart with non-empty DB and empty mutation log",
- test_mb4898, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_SQLITE),
-
+ test_mb4898, test_setup, teardown, NULL, prepare,
+ cleanup, BACKEND_SQLITE),
// disk>RAM tests
TestCase("verify not multi dispatcher", test_not_multi_dispatcher_conf,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_SQLITE),
- TestCase("disk>RAM golden path", test_disk_gt_ram_golden, NULL,
- teardown, "chk_remover_stime=1;chk_period=60", prepare,
- cleanup, BACKEND_ALL),
- TestCase("disk>RAM paged-out rm", test_disk_gt_ram_paged_rm, NULL,
- teardown, "chk_remover_stime=1;chk_period=60", prepare,
- cleanup, BACKEND_ALL),
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_SQLITE),
+ TestCase("disk>RAM golden path", test_disk_gt_ram_golden,
+ test_setup, teardown,
+ "chk_remover_stime=1;chk_period=60", prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("disk>RAM paged-out rm", test_disk_gt_ram_paged_rm,
+ test_setup, teardown,
+ "chk_remover_stime=1;chk_period=60", prepare, cleanup,
+ BACKEND_ALL),
TestCase("disk>RAM update paged-out", test_disk_gt_ram_update_paged_out,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
TestCase("disk>RAM delete paged-out", test_disk_gt_ram_delete_paged_out,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("disk>RAM paged-out incr", test_disk_gt_ram_incr, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("disk>RAM set bgfetch race", test_disk_gt_ram_set_race, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("disk>RAM incr bgfetch race", test_disk_gt_ram_incr_race, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("disk>RAM delete bgfetch race", test_disk_gt_ram_rm_race, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- // disk>RAM tests with WAL
- TestCase("verify multi dispatcher", test_multi_dispatcher_conf, NULL,
- teardown, MULTI_DISPATCHER_CONFIG, prepare, cleanup,
+ test_setup, teardown, NULL, prepare, cleanup,
BACKEND_ALL),
- TestCase("verify multi dispatcher override",
- test_not_multi_dispatcher_conf, NULL, teardown,
- MULTI_DISPATCHER_CONFIG ";concurrentDB=false", prepare,
- cleanup, BACKEND_ALL),
- TestCase("disk>RAM golden path (wal)", test_disk_gt_ram_golden, NULL,
- teardown, MULTI_DISPATCHER_CONFIG, prepare, cleanup,
+ TestCase("disk>RAM paged-out incr", test_disk_gt_ram_incr,
+ test_setup, teardown, NULL, prepare, cleanup,
BACKEND_ALL),
- TestCase("disk>RAM paged-out rm (wal)", test_disk_gt_ram_paged_rm,
- NULL, teardown, MULTI_DISPATCHER_CONFIG, prepare, cleanup,
+ TestCase("disk>RAM set bgfetch race", test_disk_gt_ram_set_race,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("disk>RAM incr bgfetch race", test_disk_gt_ram_incr_race,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("disk>RAM delete bgfetch race", test_disk_gt_ram_rm_race,
+ test_setup, teardown, NULL, prepare, cleanup,
BACKEND_ALL),
+ // disk>RAM tests with WAL
+ TestCase("verify multi dispatcher", test_multi_dispatcher_conf,
+ test_setup, teardown, MULTI_DISPATCHER_CONFIG,
+ prepare, cleanup, BACKEND_ALL),
+ TestCase("verify multi dispatcher override",
+ test_not_multi_dispatcher_conf, test_setup,
+ teardown, MULTI_DISPATCHER_CONFIG ";concurrentDB=false",
+ prepare, cleanup, BACKEND_ALL),
+ TestCase("disk>RAM golden path (wal)", test_disk_gt_ram_golden,
+ test_setup, teardown, MULTI_DISPATCHER_CONFIG,
+ prepare, cleanup, BACKEND_ALL),
+ TestCase("disk>RAM paged-out rm (wal)", test_disk_gt_ram_paged_rm,
+ test_setup, teardown, MULTI_DISPATCHER_CONFIG,
+ prepare, cleanup, BACKEND_ALL),
TestCase("disk>RAM update paged-out (wal)",
- test_disk_gt_ram_update_paged_out, NULL,
+ test_disk_gt_ram_update_paged_out, test_setup,
teardown, MULTI_DISPATCHER_CONFIG, prepare, cleanup,
BACKEND_ALL),
TestCase("disk>RAM delete paged-out (wal)",
- test_disk_gt_ram_delete_paged_out, NULL,
- teardown, MULTI_DISPATCHER_CONFIG, prepare, cleanup,
- BACKEND_ALL),
- TestCase("disk>RAM paged-out incr (wal)", test_disk_gt_ram_incr, NULL,
+ test_disk_gt_ram_delete_paged_out, test_setup,
teardown, MULTI_DISPATCHER_CONFIG, prepare, cleanup,
BACKEND_ALL),
+ TestCase("disk>RAM paged-out incr (wal)", test_disk_gt_ram_incr,
+ test_setup, teardown, MULTI_DISPATCHER_CONFIG,
+ prepare, cleanup, BACKEND_ALL),
TestCase("disk>RAM set bgfetch race (wal)", test_disk_gt_ram_set_race,
- NULL, teardown, MULTI_DISPATCHER_CONFIG, prepare, cleanup,
- BACKEND_ALL),
+ test_setup, teardown, MULTI_DISPATCHER_CONFIG,
+ prepare, cleanup, BACKEND_ALL),
TestCase("disk>RAM incr bgfetch race (wal)", test_disk_gt_ram_incr_race,
- NULL, teardown, MULTI_DISPATCHER_CONFIG, prepare, cleanup,
- BACKEND_ALL),
+ test_setup, teardown, MULTI_DISPATCHER_CONFIG,
+ prepare, cleanup, BACKEND_ALL),
TestCase("disk>RAM delete bgfetch race (wal)", test_disk_gt_ram_rm_race,
- NULL, teardown, MULTI_DISPATCHER_CONFIG, prepare, cleanup,
- BACKEND_ALL),
- // vbucket negative tests
- TestCase("vbucket incr (dead)", test_wrong_vb_incr, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket incr (pending)", test_vb_incr_pending, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket incr (replica)", test_vb_incr_replica, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket get (dead)", test_wrong_vb_get, NULL, teardown, NULL,
+ test_setup, teardown, MULTI_DISPATCHER_CONFIG,
prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket get (pending)", test_vb_get_pending, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket get (replica)", test_vb_get_replica, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
+ // vbucket negative tests
+ TestCase("vbucket incr (dead)", test_wrong_vb_incr,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket incr (pending)", test_vb_incr_pending,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket incr (replica)", test_vb_incr_replica,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket get (dead)", test_wrong_vb_get,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket get (pending)", test_vb_get_pending,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket get (replica)", test_vb_get_replica,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
TestCase("vbucket getl (dead)", NULL, NULL, teardown, NULL, prepare,
cleanup, BACKEND_ALL),
TestCase("vbucket getl (pending)", NULL, NULL, teardown, NULL,
prepare, cleanup, BACKEND_ALL),
TestCase("vbucket getl (replica)", NULL, NULL, teardown, NULL,
prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket set (dead)", test_wrong_vb_set, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket set (pending)", test_vb_set_pending, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket set (replica)", test_vb_set_replica, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket replace (dead)", test_wrong_vb_replace, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket replace (pending)", test_vb_replace_pending, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket replace (replica)", test_vb_replace_replica, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket add (dead)", test_wrong_vb_add, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket add (pending)", test_vb_add_pending, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket add (replica)", test_vb_add_replica, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket cas (dead)", test_wrong_vb_cas, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket cas (pending)", test_vb_cas_pending, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket cas (replica)", test_vb_cas_replica, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket append (dead)", test_wrong_vb_append, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket append (pending)", test_vb_append_pending, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket append (replica)", test_vb_append_replica, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket prepend (dead)", test_wrong_vb_prepend, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket prepend (pending)", test_vb_prepend_pending, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket prepend (replica)", test_vb_prepend_replica, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket del (dead)", test_wrong_vb_del, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket del (pending)", test_vb_del_pending, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("vbucket del (replica)", test_vb_del_replica, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("vbucket set (dead)", test_wrong_vb_set,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket set (pending)", test_vb_set_pending,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket set (replica)", test_vb_set_replica,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket replace (dead)", test_wrong_vb_replace,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket replace (pending)", test_vb_replace_pending,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket replace (replica)", test_vb_replace_replica,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket add (dead)", test_wrong_vb_add,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket add (pending)", test_vb_add_pending,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket add (replica)", test_vb_add_replica,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket cas (dead)", test_wrong_vb_cas,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket cas (pending)", test_vb_cas_pending,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket cas (replica)", test_vb_cas_replica,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket append (dead)", test_wrong_vb_append,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket append (pending)", test_vb_append_pending,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket append (replica)", test_vb_append_replica,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket prepend (dead)", test_wrong_vb_prepend,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket prepend (pending)", test_vb_prepend_pending,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket prepend (replica)", test_vb_prepend_replica,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket del (dead)", test_wrong_vb_del,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket del (pending)", test_vb_del_pending,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("vbucket del (replica)", test_vb_del_replica,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
// Vbucket management tests
- TestCase("no vb0 at startup", test_novb0, NULL, teardown, "vb0=false",
- prepare, cleanup, BACKEND_ALL),
- TestCase("test vbucket get", test_vbucket_get, NULL, teardown, NULL,
- prepare, cleanup, BACKEND_ALL),
- TestCase("test vbucket get missing", test_vbucket_get_miss, NULL,
+ TestCase("no vb0 at startup", test_novb0,
+ test_setup, teardown, "vb0=false", prepare,
+ cleanup, BACKEND_ALL),
+ TestCase("test vbucket get", test_vbucket_get, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("test vbucket create", test_vbucket_create, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("test vbucket destroy", test_vbucket_destroy, NULL, teardown,
- NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("test vbucket get missing", test_vbucket_get_miss,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("test vbucket create", test_vbucket_create,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("test vbucket destroy", test_vbucket_destroy,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
TestCase("test vbucket destroy (multitable)", test_vbucket_destroy,
- NULL, teardown,
+ test_setup, teardown,
"db_strategy=multiMTVBDB;max_vbuckets=16;ht_size=7;ht_locks=3",
prepare, cleanup, BACKEND_ALL),
TestCase("test vbucket destroy stats", test_vbucket_destroy_stats,
- NULL, teardown, "chk_remover_stime=1;chk_period=60",
+ test_setup, teardown,
+ "chk_remover_stime=1;chk_period=60",
prepare, cleanup, BACKEND_ALL),
TestCase("test vbucket destroy restart", test_vbucket_destroy_restart,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
// checkpoint tests
TestCase("checkpoint: create a new checkpoint",
test_create_new_checkpoint,
- NULL, teardown, "chk_max_items=500;item_num_based_new_chk=true",
+ test_setup, teardown,
+ "chk_max_items=500;item_num_based_new_chk=true",
prepare, cleanup, BACKEND_ALL),
TestCase("checkpoint: extend the open checkpoint",
test_extend_open_checkpoint,
- NULL, teardown, "chk_remover_stime=1;chk_max_items=500",
+ test_setup, teardown,
+ "chk_remover_stime=1;chk_max_items=500",
prepare, cleanup, BACKEND_ALL),
TestCase("checkpoint: validate checkpoint config params",
test_validate_checkpoint_params,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("test checkpoint collapse", test_checkpoint_collapse, NULL, teardown,
- "chk_max_items=5000;chk_period=600",
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_ALL),
+ TestCase("test checkpoint collapse", test_checkpoint_collapse,
+ test_setup, teardown,
+ "chk_max_items=1000;chk_period=600",
prepare, cleanup, BACKEND_ALL),
- TestCase("test checkpoint create", test_checkpoint_create, NULL, teardown,
+ TestCase("test checkpoint create", test_checkpoint_create,
+ test_setup, teardown,
"chk_max_items=5000;chk_period=600",
prepare, cleanup, BACKEND_ALL),
- TestCase("test checkpoint timeout", test_checkpoint_timeout, NULL, teardown,
+ TestCase("test checkpoint timeout", test_checkpoint_timeout,
+ test_setup, teardown,
"chk_max_items=5000;chk_period=600",
prepare, cleanup, BACKEND_ALL),
- TestCase("test checkpoint deduplication", test_checkpoint_deduplication, NULL,
- teardown, "chk_max_items=5000;chk_period=600",
+ TestCase("test checkpoint deduplication", test_checkpoint_deduplication,
+ test_setup, teardown,
+ "chk_max_items=5000;chk_period=600",
prepare, cleanup, BACKEND_ALL),
// Restore tests
- TestCase("restore: not enabled", test_restore_not_enabled, NULL,
- teardown,
- "db_strategy=singleDB;dbname=:memory:", prepare, cleanup,
- BACKEND_SQLITE),
- TestCase("restore: no such file", test_restore_no_such_file, NULL,
- teardown,
+ TestCase("restore: not enabled", test_restore_not_enabled,
+ test_setup, teardown,
+ "db_strategy=singleDB;dbname=:memory:",
+ prepare, cleanup, BACKEND_SQLITE),
+ TestCase("restore: no such file", test_restore_no_such_file,
+ test_setup, teardown,
"db_strategy=singleDB;dbname=:memory:;restore_mode=true",
prepare, cleanup, BACKEND_SQLITE),
- TestCase("restore: invalid file", test_restore_invalid_file, NULL,
- teardown,
+ TestCase("restore: invalid file", test_restore_invalid_file,
+ test_setup, teardown,
"db_strategy=singleDB;dbname=:memory:;restore_mode=true",
prepare, cleanup, BACKEND_SQLITE),
TestCase("restore: data miss during restore", test_restore_data_miss,
- NULL, teardown,
+ test_setup, teardown,
"db_strategy=singleDB;dbname=:memory:;restore_mode=true",
prepare, cleanup, BACKEND_SQLITE),
- TestCase("restore: no data in there", test_restore_clean, NULL,
- teardown,
+ TestCase("restore: no data in there", test_restore_clean,
+ test_setup, teardown,
"restore_mode=true", prepare, cleanup, BACKEND_ALL),
TestCase("restore: no data in there (with partial vbucket list)",
- test_restore_clean_vbucket_subset, NULL, teardown,
+ test_restore_clean_vbucket_subset,
+ test_setup, teardown,
"restore_mode=true", prepare, cleanup, BACKEND_ALL),
- TestCase("restore: with keys", test_restore_with_data, NULL, teardown,
+ TestCase("restore: with keys", test_restore_with_data,
+ test_setup, teardown,
"db_strategy=singleDB;dbname=:memory:;restore_mode=true",
prepare, cleanup, BACKEND_SQLITE),
#ifdef future
@@ -6853,78 +6945,89 @@ engine_test_t* get_tests(void) {
prepare, cleanup, BACKEND_SQLITE),
#endif
// revision id's
- TestCase("revision sequence numbers", test_revid, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_ALL),
+ TestCase("revision sequence numbers", test_revid,
+ test_setup, teardown, NULL, prepare,
+ cleanup, BACKEND_ALL),
- TestCase("mb-4314", test_regression_mb4314, NULL,
+ TestCase("mb-4314", test_regression_mb4314, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("mb-3466", test_mb3466, NULL,
+ TestCase("mb-3466", test_mb3466, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_ALL),
// XDCR unit tests
- TestCase("get meta", test_get_meta, NULL,
+ TestCase("get meta", test_get_meta, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_COUCH),
- TestCase("get meta deleted", test_get_meta_deleted, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_COUCH),
+ TestCase("get meta deleted", test_get_meta_deleted,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_COUCH),
- TestCase("get meta nonexistent", test_get_meta_nonexistent, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_COUCH),
+ TestCase("get meta nonexistent", test_get_meta_nonexistent,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_COUCH),
- TestCase("get meta followed by get", test_get_meta_with_get, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_COUCH),
+ TestCase("get meta followed by get", test_get_meta_with_get,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_COUCH),
- TestCase("get meta followed by set", test_get_meta_with_set, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_COUCH),
+ TestCase("get meta followed by set", test_get_meta_with_set,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_COUCH),
- TestCase("get meta followed by delete", test_get_meta_with_delete, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_COUCH),
+ TestCase("get meta followed by delete", test_get_meta_with_delete,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_COUCH),
- TestCase("add with meta", test_add_with_meta, NULL,
+ TestCase("add with meta", test_add_with_meta, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_ALL),
- TestCase("delete with meta", test_delete_with_meta, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_COUCH),
+ TestCase("delete with meta", test_delete_with_meta,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_COUCH),
TestCase("delete with meta deleted", test_delete_with_meta_deleted,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_COUCH),
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_COUCH),
TestCase("delete with meta nonexistent",
- test_delete_with_meta_nonexistent, NULL,
+ test_delete_with_meta_nonexistent, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_COUCH),
TestCase("delete_with_meta race with concurrent delete",
- test_delete_with_meta_race_with_delete, NULL,
+ test_delete_with_meta_race_with_delete, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_COUCH),
TestCase("delete_with_meta race with concurrent set",
- test_delete_with_meta_race_with_set, NULL,
+ test_delete_with_meta_race_with_set, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_COUCH),
- TestCase("set with meta", test_set_with_meta, NULL,
+ TestCase("set with meta", test_set_with_meta, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_COUCH),
- TestCase("set with meta deleted", test_set_with_meta_deleted, NULL,
- teardown, NULL, prepare, cleanup, BACKEND_COUCH),
+ TestCase("set with meta deleted", test_set_with_meta_deleted,
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_COUCH),
TestCase("set with meta nonexistent", test_set_with_meta_nonexistent,
- NULL, teardown, NULL, prepare, cleanup, BACKEND_COUCH),
+ test_setup, teardown, NULL, prepare, cleanup,
+ BACKEND_COUCH),
TestCase("set_with_meta race with concurrent set",
- test_set_with_meta_race_with_set, NULL,
+ test_set_with_meta_race_with_set, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_COUCH),
TestCase("set_with_meta race with concurrent delete",
- test_set_with_meta_race_with_delete, NULL,
+ test_set_with_meta_race_with_delete, test_setup,
teardown, NULL, prepare, cleanup, BACKEND_COUCH),
- TestCase("temp item deletion", test_temp_item_deletion, NULL,teardown,
+ TestCase("temp item deletion", test_temp_item_deletion,
+ test_setup,teardown,
"exp_pager_stime=3", prepare, cleanup, BACKEND_COUCH),
// mutation log compactor tests
TestCase("compact a mutation log", test_compact_mutation_log,
- NULL, teardown,
+ test_setup, teardown,
"klog_path=/tmp/mutation.log;klog_max_log_size=32768;"
"klog_max_entry_ratio=2;klog_compactor_stime=5",
prepare, cleanup, BACKEND_ALL),
Please sign in to comment.
Something went wrong with that request. Please try again.