Commit 9e1422f0 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#3462 remove a big blob test refs[t:3462]

git-svn-id: file:///svn/toku/tokudb@30449 c7de825b-a66e-492c-adef-691d508d4ae1
parent a98cdfee
...@@ -126,7 +126,6 @@ BDB_DONTRUN_TESTS = \ ...@@ -126,7 +126,6 @@ BDB_DONTRUN_TESTS = \
keyrange-dupsort \ keyrange-dupsort \
keyrange-dupsort-unflat \ keyrange-dupsort-unflat \
keyrange-unflat \ keyrange-unflat \
loader-blobs-create-leaf \
loader-cleanup-test \ loader-cleanup-test \
loader-create-abort \ loader-create-abort \
loader-create-close \ loader-create-close \
...@@ -320,6 +319,7 @@ BDB_BINS = $(patsubst %.c,%.bdb$(BINSUF),$(filter-out $(patsubst %,%.c,$(BDB_DON ...@@ -320,6 +319,7 @@ BDB_BINS = $(patsubst %.c,%.bdb$(BINSUF),$(filter-out $(patsubst %,%.c,$(BDB_DON
endif endif
TDB_TESTS_THAT_SHOULD_FAIL= \ TDB_TESTS_THAT_SHOULD_FAIL= \
loader_blobs_leaf_split \
test_blobs_leaf_split \ test_blobs_leaf_split \
test_truncate_txn_abort \ test_truncate_txn_abort \
test_db_no_env \ test_db_no_env \
......
...@@ -36,12 +36,13 @@ static void insert(DB_LOADER *loader, int k, int val_size) { ...@@ -36,12 +36,13 @@ static void insert(DB_LOADER *loader, int k, int val_size) {
DBT key = { .data = key_buffer, .size = sizeof key_buffer }; DBT key = { .data = key_buffer, .size = sizeof key_buffer };
DBT value = { .data = val_buffer, .size = val_size }; DBT value = { .data = val_buffer, .size = val_size };
r = loader->put(loader, &key, &value); assert(r == 0); r = loader->put(loader, &key, &value); assert_zero(r);
toku_free(val_buffer); toku_free(val_buffer);
} }
int test_main(int argc, char * const argv[]) { int test_main(int argc, char * const argv[]) {
uint32_t loader_flags = 0;
#if defined(TOKUDB) #if defined(TOKUDB)
char *db_env_dir = "blobs.leafsplit.env.tokudb"; char *db_env_dir = "blobs.leafsplit.env.tokudb";
#else #else
...@@ -64,6 +65,10 @@ int test_main(int argc, char * const argv[]) { ...@@ -64,6 +65,10 @@ int test_main(int argc, char * const argv[]) {
if (verbose > 0) verbose--; if (verbose > 0) verbose--;
continue; continue;
} }
if (strcmp(arg, "-p") == 0) {
loader_flags = LOADER_USE_PUTS;
continue;
}
if (strcmp(arg, "--txn") == 0 && i+1 < argc) { if (strcmp(arg, "--txn") == 0 && i+1 < argc) {
do_txn = atoi(argv[++i]); do_txn = atoi(argv[++i]);
continue; continue;
...@@ -83,52 +88,52 @@ int test_main(int argc, char * const argv[]) { ...@@ -83,52 +88,52 @@ int test_main(int argc, char * const argv[]) {
int r; int r;
char rm_cmd[strlen(db_env_dir) + strlen("rm -rf ") + 1]; char rm_cmd[strlen(db_env_dir) + strlen("rm -rf ") + 1];
snprintf(rm_cmd, sizeof(rm_cmd), "rm -rf %s", db_env_dir); snprintf(rm_cmd, sizeof(rm_cmd), "rm -rf %s", db_env_dir);
r = system(rm_cmd); assert(r == 0); r = system(rm_cmd); assert_zero(r);
r = toku_os_mkdir(db_env_dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); assert(r == 0); r = toku_os_mkdir(db_env_dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); assert_zero(r);
// create and open the env // create and open the env
DB_ENV *db_env = NULL; DB_ENV *db_env = NULL;
r = db_env_create(&db_env, 0); assert(r == 0); r = db_env_create(&db_env, 0); assert_zero(r);
if (cachesize) { if (cachesize) {
const u_int64_t gig = 1 << 30; const u_int64_t gig = 1 << 30;
r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0); r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert_zero(r);
} }
r = db_env->set_generate_row_callback_for_put(db_env, my_row_generate); assert(r == 0); r = db_env->set_generate_row_callback_for_put(db_env, my_row_generate); assert_zero(r);
r = db_env->set_default_bt_compare(db_env, my_bt_compare); assert(r == 0); r = db_env->set_default_bt_compare(db_env, my_bt_compare); assert_zero(r);
if (!do_txn) if (!do_txn)
db_env_open_flags &= ~(DB_INIT_TXN | DB_INIT_LOG); db_env_open_flags &= ~(DB_INIT_TXN | DB_INIT_LOG);
r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0); r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert_zero(r);
// create the db // create the db
DB *db = NULL; DB *db = NULL;
r = db_create(&db, db_env, 0); assert(r == 0); r = db_create(&db, db_env, 0); assert_zero(r);
DB_TXN *create_txn = NULL; DB_TXN *create_txn = NULL;
if (do_txn) { if (do_txn) {
r = db_env->txn_begin(db_env, NULL, &create_txn, 0); assert(r == 0); r = db_env->txn_begin(db_env, NULL, &create_txn, 0); assert_zero(r);
} }
if (pagesize) { if (pagesize) {
r = db->set_pagesize(db, pagesize); assert(r == 0); r = db->set_pagesize(db, pagesize); assert_zero(r);
} }
r = db->open(db, create_txn, db_filename, NULL, DB_BTREE, DB_CREATE, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0); r = db->open(db, create_txn, db_filename, NULL, DB_BTREE, DB_CREATE, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert_zero(r);
DB_LOADER *loader = NULL; DB_LOADER *loader = NULL;
uint32_t db_flags = 0; uint32_t db_flags = 0;
uint32_t dbt_flags = 0; uint32_t dbt_flags = 0;
r = db_env->create_loader(db_env, create_txn, &loader, db, 1, &db, &db_flags, &dbt_flags, 0); assert(r == 0); r = db_env->create_loader(db_env, create_txn, &loader, db, 1, &db, &db_flags, &dbt_flags, loader_flags); assert_zero(r);
insert(loader, 1, 8000000); insert(loader, 1, 8000000);
insert(loader, 2, 1); insert(loader, 2, 1);
r = loader->close(loader); assert(r == 0); r = loader->close(loader); assert_zero(r);
if (do_txn) { if (do_txn) {
r = create_txn->commit(create_txn, 0); assert(r == 0); r = create_txn->commit(create_txn, 0); assert_zero(r);
} }
// shutdown // shutdown
r = db->close(db, 0); assert(r == 0); db = NULL; r = db->close(db, 0); assert_zero(r); db = NULL;
r = db_env->close(db_env, 0); assert(r == 0); db_env = NULL; r = db_env->close(db_env, 0); assert_zero(r); db_env = NULL;
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment