Skip to content

Commit

Permalink
disable an unstable test case (#3600)
Browse files Browse the repository at this point in the history
* disable an unstable test case

* address comments
  • Loading branch information
liuyu85cn authored Jan 4, 2022
1 parent f52a964 commit 069125f
Showing 1 changed file with 2 additions and 37 deletions.
39 changes: 2 additions & 37 deletions src/storage/test/ChainDeleteEdgesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,6 @@ constexpr int32_t mockSpaceId = 1;
constexpr int32_t mockPartNum = 1;
constexpr int32_t gTerm = 1;

class GlobalCluster {
public:
static mock::MockCluster* get() {
static mock::MockCluster cluster;
static fs::TempDir rootPath("/tmp/DeleteEdgesTest.XXXXXX");
static bool init = false;
if (!init) {
cluster.initStorageKV(rootPath.path());
init = true;
}
return &cluster;
}
};

// class FakeChainDeleteEdgesProcessor;
class FakeChainDeleteEdgesProcessor : public ChainDeleteEdgesLocalProcessor {
public:
explicit FakeChainDeleteEdgesProcessor(StorageEnv* env);
Expand Down Expand Up @@ -83,12 +68,8 @@ TEST(ChainDeleteEdgesTest, TestUtilsTest) {
auto fut = proc->getFuture();
proc->process(req);
auto resp = std::move(fut).get();
// EXPECT_EQ(0, resp.result.failed_parts.size());

LOG(INFO) << "Check data in kv store...";
// sleep(1);
// The number of data in serve is 334
// checkAddEdgesData(req, env, 0, 0);
}

// delete a not exist edge
Expand All @@ -103,9 +84,7 @@ TEST(ChainDeleteEdgesTest, Test2) {

auto* proc = new FakeChainDeleteEdgesProcessor(env);

// proc->rcPrepareLocal = nebula::cpp2::ErrorCode::SUCCEEDED;
proc->rcProcessRemote = nebula::cpp2::ErrorCode::SUCCEEDED;
// proc->rcProcessLocal = nebula::cpp2::ErrorCode::SUCCEEDED;

LOG(INFO) << "Build DeleteEdgesReq...";
auto req = mock::MockData::mockDeleteEdgesReq(mockPartNum);
Expand Down Expand Up @@ -151,12 +130,7 @@ TEST(ChainDeleteEdgesTest, Test3) {

auto* delProc = new FakeChainDeleteEdgesProcessor(env);
auto delReq = delProc->makeDelRequest(addReq);
// delProc->rcPrepareLocal = nebula::cpp2::ErrorCode::SUCCEEDED;
delProc->rcProcessRemote = nebula::cpp2::ErrorCode::SUCCEEDED;
// delProc->rcProcessLocal = nebula::cpp2::ErrorCode::SUCCEEDED;

LOG(INFO) << "Build DeleteEdgesReq...";
// auto req = mock::MockData::mockDeleteEdgesReq(mockPartNum);

LOG(INFO) << "Run DeleteEdgesReq...";
auto futDel = delProc->getFuture();
Expand Down Expand Up @@ -201,12 +175,7 @@ TEST(ChainDeleteEdgesTest, Test4) {
auto* delProc = new FakeChainDeleteEdgesProcessor(env);
int32_t limit = 1;
auto delReq = delProc->makeDelRequest(addReq, limit);
// delProc->rcPrepareLocal = nebula::cpp2::ErrorCode::SUCCEEDED;
delProc->rcProcessRemote = nebula::cpp2::ErrorCode::SUCCEEDED;
// delProc->rcProcessLocal = nebula::cpp2::ErrorCode::SUCCEEDED;

LOG(INFO) << "Build DeleteEdgesReq...";
// auto req = mock::MockData::mockDeleteEdgesReq(mockPartNum);

LOG(INFO) << "Run DeleteEdgesReq...";
auto futDel = delProc->getFuture();
Expand All @@ -220,7 +189,7 @@ TEST(ChainDeleteEdgesTest, Test4) {
}

// add some edges, then delete one of them, not execute local commit
TEST(ChainDeleteEdgesTest, Test5) {
TEST(ChainDeleteEdgesTest, DISABLED_Test5) {
fs::TempDir rootPath("/tmp/DeleteEdgesTest.XXXXXX");
mock::MockCluster cluster;
cluster.initStorageKV(rootPath.path());
Expand Down Expand Up @@ -250,13 +219,9 @@ TEST(ChainDeleteEdgesTest, Test5) {

auto* delProc = new FakeChainDeleteEdgesProcessor(env);
auto delReq = delProc->makeDelRequest(addReq);
// delProc->rcPrepareLocal = nebula::cpp2::ErrorCode::SUCCEEDED;
delProc->rcProcessRemote = nebula::cpp2::ErrorCode::SUCCEEDED;
delProc->rcProcessLocal = nebula::cpp2::ErrorCode::SUCCEEDED;

LOG(INFO) << "Build DeleteEdgesReq...";
// auto req = mock::MockData::mockDeleteEdgesReq(mockPartNum);

LOG(INFO) << "Run DeleteEdgesReq...";
auto futDel = delProc->getFuture();
delProc->process(delReq);
Expand All @@ -271,9 +236,9 @@ TEST(ChainDeleteEdgesTest, Test5) {
FakeInternalStorageClient::hookInternalStorageClient(env, iClient);
ChainResumeProcessor resumeProc(env);
resumeProc.process();
// std::this_thread::sleep_for(std::chrono::milliseconds());
num = util.checkNumOfKey(env, mockSpaceId, edgeKeys);
EXPECT_EQ(num, 0);
std::this_thread::sleep_for(std::chrono::milliseconds(300));

delete iClient;
}
Expand Down

0 comments on commit 069125f

Please sign in to comment.