1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
Testcases for NF


ndb/src/kernel/blocks/ERROR_codes.txt:
  Error insert for testing NF handling of committed read
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Error insert for testing NF handling of committed read
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  Error insert for testing NF handling of committed read
ndb/test/include/NDBT_Test.hpp:
  Move sync methods into NDBT_Context
ndb/test/ndbapi/testIndex.cpp:
  Move sync methods into NDBT_Context
ndb/test/ndbapi/testNodeRestart.cpp:
  Add test case that verifies committed read during NF
ndb/test/src/NDBT_Test.cpp:
  Move sync methods into NDBT_Context
This commit is contained in:
unknown
2004-10-08 17:44:20 +02:00
parent 950c682593
commit 2e201e1e7b
7 changed files with 87 additions and 37 deletions

View File

@ -380,27 +380,6 @@ runVerifyIndex(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_OK;
}
int
sync_down(NDBT_Context* ctx){
Uint32 threads = ctx->getProperty("PauseThreads", (unsigned)0);
if(threads){
ctx->decProperty("PauseThreads");
}
return 0;
}
int
sync_up_and_wait(NDBT_Context* ctx){
Uint32 threads = ctx->getProperty("Threads", (unsigned)0);
ndbout_c("Setting PauseThreads to %d", threads);
ctx->setProperty("PauseThreads", threads);
ctx->getPropertyWait("PauseThreads", (unsigned)0);
if(threads){
ndbout_c("wait completed");
}
return 0;
}
int
runTransactions1(NDBT_Context* ctx, NDBT_Step* step){
// Verify that data in index match
@ -416,7 +395,7 @@ runTransactions1(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_FAILED;
}
sync_down(ctx);
ctx->sync_down("PauseThreads");
if(ctx->isTestStopped())
break;
@ -425,7 +404,7 @@ runTransactions1(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_FAILED;
}
sync_down(ctx);
ctx->sync_down("PauseThreads");
}
return NDBT_OK;
}
@ -446,7 +425,7 @@ runTransactions2(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_FAILED;
}
#endif
sync_down(ctx);
ctx->sync_down("PauseThreads");
if(ctx->isTestStopped())
break;
#if 1
@ -455,7 +434,7 @@ runTransactions2(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_FAILED;
}
#endif
sync_down(ctx);
ctx->sync_down("PauseThreads");
}
return NDBT_OK;
}
@ -476,7 +455,7 @@ runTransactions3(NDBT_Context* ctx, NDBT_Step* step){
g_err << "Load table failed" << endl;
return NDBT_FAILED;
}
sync_down(ctx);
ctx->sync_down("PauseThreads");
if(ctx->isTestStopped())
break;
@ -485,7 +464,7 @@ runTransactions3(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_FAILED;
}
sync_down(ctx);
ctx->sync_down("PauseThreads");
if(ctx->isTestStopped())
break;
@ -494,7 +473,7 @@ runTransactions3(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_FAILED;
}
sync_down(ctx);
ctx->sync_down("PauseThreads");
if(ctx->isTestStopped())
break;
@ -503,7 +482,7 @@ runTransactions3(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_FAILED;
}
sync_down(ctx);
ctx->sync_down("PauseThreads");
if(ctx->isTestStopped())
break;
@ -512,7 +491,7 @@ runTransactions3(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_FAILED;
}
sync_down(ctx);
ctx->sync_down("PauseThreads");
if(ctx->isTestStopped())
break;
@ -521,14 +500,14 @@ runTransactions3(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_FAILED;
}
sync_down(ctx);
ctx->sync_down("PauseThreads");
if(ctx->isTestStopped())
break;
int count = -1;
if(utilTrans.selectCount(pNdb, 64, &count) != 0 || count != 0)
return NDBT_FAILED;
sync_down(ctx);
ctx->sync_down("PauseThreads");
}
return NDBT_OK;
}
@ -540,6 +519,7 @@ int runRestarts(NDBT_Context* ctx, NDBT_Step* step){
NdbRestarts restarts;
int i = 0;
int timeout = 240;
int sync_threads = ctx->getProperty("Threads", (unsigned)0);
while(i<loops && result != NDBT_FAILED && !ctx->isTestStopped()){
if(restarts.executeRestart("RestartRandomNodeAbort", timeout) != 0){
@ -547,7 +527,7 @@ int runRestarts(NDBT_Context* ctx, NDBT_Step* step){
result = NDBT_FAILED;
break;
}
sync_up_and_wait(ctx);
ctx->sync_up_and_wait("PauseThreads", sync_threads);
i++;
}
ctx->stopTest();