mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
[t:2499] loader-cleanup-test Remove -a and -e options, make default.
git-svn-id: file:///svn/toku/tokudb@20170 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
9c891e5501
commit
cd7927ea01
1 changed files with 14 additions and 21 deletions
|
@ -8,11 +8,6 @@
|
||||||
* When loader is fixed to not crash on failed call to toku_os_write(),
|
* When loader is fixed to not crash on failed call to toku_os_write(),
|
||||||
* get rid of INDUCE_BAD_WRITE and -e argument.
|
* get rid of INDUCE_BAD_WRITE and -e argument.
|
||||||
*
|
*
|
||||||
* When loader is fixed to not crash when poll function returns non-zero
|
|
||||||
* value with size_factor=1, get rid of INDUCE_ABORT and -a argument.
|
|
||||||
*
|
|
||||||
* When loader is fixed to not crash on failed call to do_fwrite() with small size factor,
|
|
||||||
* get rid of SIZE_FACTOR and -s argument.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,8 +66,7 @@ int NUM_ROWS=100000;
|
||||||
int CHECK_RESULTS=0;
|
int CHECK_RESULTS=0;
|
||||||
int USE_PUTS=0;
|
int USE_PUTS=0;
|
||||||
int INDUCE_BAD_WRITE=0;
|
int INDUCE_BAD_WRITE=0;
|
||||||
int INDUCE_ABORT = 0;
|
int assert_temp_files = 0;
|
||||||
int SIZE_FACTOR = 0;
|
|
||||||
enum {MAGIC=311};
|
enum {MAGIC=311};
|
||||||
|
|
||||||
|
|
||||||
|
@ -478,7 +472,10 @@ static void test_loader(enum test_type t, DB **dbs)
|
||||||
CKERR(r);
|
CKERR(r);
|
||||||
if (!USE_PUTS) {
|
if (!USE_PUTS) {
|
||||||
assert(poll_count>0);
|
assert(poll_count>0);
|
||||||
// assert(n); // test is not complete unless temp files are created
|
if (assert_temp_files && n == 0) {
|
||||||
|
printf("Test is not complete if no temp files are created.\n");
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (t == abort_via_poll) {
|
else if (t == abort_via_poll) {
|
||||||
|
@ -606,7 +603,7 @@ static void run_all_tests(void) {
|
||||||
|
|
||||||
if (verbose) printf("\n\nTesting loader with loader abort and txn abort\n");
|
if (verbose) printf("\n\nTesting loader with loader abort and txn abort\n");
|
||||||
run_test(abort_loader, 0);
|
run_test(abort_loader, 0);
|
||||||
if (!USE_PUTS && INDUCE_ABORT) {
|
if (!USE_PUTS) {
|
||||||
if (verbose) printf("\n\nTesting loader with loader abort_via_poll and txn abort\n");
|
if (verbose) printf("\n\nTesting loader with loader abort_via_poll and txn abort\n");
|
||||||
run_test(abort_via_poll, 0);
|
run_test(abort_via_poll, 0);
|
||||||
}
|
}
|
||||||
|
@ -650,12 +647,14 @@ int test_main(int argc, char * const *argv) {
|
||||||
do_args(argc, argv);
|
do_args(argc, argv);
|
||||||
|
|
||||||
if (verbose) printf("\nTesting loader with default size_factor\n");
|
if (verbose) printf("\nTesting loader with default size_factor\n");
|
||||||
|
assert_temp_files = 0;
|
||||||
run_all_tests();
|
run_all_tests();
|
||||||
if (SIZE_FACTOR) {
|
|
||||||
if (verbose) printf("\nTesting loader with size_factor=1\n");
|
if (verbose) printf("\nTesting loader with size_factor=1\n");
|
||||||
db_env_set_loader_size_factor(1);
|
db_env_set_loader_size_factor(1);
|
||||||
|
assert_temp_files = 1;
|
||||||
run_all_tests();
|
run_all_tests();
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -692,13 +691,7 @@ static void do_args(int argc, char * const argv[]) {
|
||||||
printf("Using puts\n");
|
printf("Using puts\n");
|
||||||
} else if (strcmp(argv[0], "-e")==0) {
|
} else if (strcmp(argv[0], "-e")==0) {
|
||||||
INDUCE_BAD_WRITE = 1;
|
INDUCE_BAD_WRITE = 1;
|
||||||
printf("Using enospc\n");
|
printf("Using enospc return from toku_os_write()\n");
|
||||||
} else if (strcmp(argv[0], "-a")==0) {
|
|
||||||
INDUCE_ABORT = 1;
|
|
||||||
printf ("Testing abort via poll with smaller size factor\n");
|
|
||||||
} else if (strcmp(argv[0], "-s")==0) {
|
|
||||||
SIZE_FACTOR = 1;
|
|
||||||
printf ("Testing abort via poll with smaller size factor\n");
|
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Unknown arg: %s\n", argv[0]);
|
fprintf(stderr, "Unknown arg: %s\n", argv[0]);
|
||||||
resultcode=1;
|
resultcode=1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue