Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable an unstable test case #3600

Merged
merged 3 commits into from
Jan 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use DISABLE_Test5 to disable this test case

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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't remove directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is just for not cause other CI failed. Will dig more until it stable.
Thus it will have some debug code. Not sure if this is the unstable point.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could convert it to a draft PR.

num = util.checkNumOfKey(env, mockSpaceId, edgeKeys);
EXPECT_EQ(num, 0);
std::this_thread::sleep_for(std::chrono::milliseconds(300));

delete iClient;
}
Expand Down