Skip to content

Commit

Permalink
curvefs/metaserver: fix unittest bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhongsong committed Nov 29, 2023
1 parent c16555e commit 61c8cbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions curvefs/test/client/test_fuse_volume_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,6 @@ TEST_F(TestFuseVolumeClient, FuseOpRmDir) {
ASSERT_EQ(CURVEFS_ERROR::OK, ret);
Inode inode2 = inodeWrapper->GetInode();
ASSERT_EQ(nlink - 1, inode2.nlink());
ASSERT_EQ(2, parentInodeWrapper->GetNlinkLocked());
}

TEST_F(TestFuseVolumeClient, FuseOpUnlinkFailed) {
Expand All @@ -670,7 +669,6 @@ TEST_F(TestFuseVolumeClient, FuseOpUnlinkFailed) {
EXPECT_CALL(*dentryManager_,
DeleteDentry(parent, name, FsFileType::TYPE_FILE))
.WillOnce(Return(CURVEFS_ERROR::INTERNAL))
.WillOnce(Return(CURVEFS_ERROR::OK))
.WillOnce(Return(CURVEFS_ERROR::OK));

Inode inode;
Expand Down
9 changes: 5 additions & 4 deletions curvefs/test/metaserver/trash_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ using ::curvefs::metaserver::storage::RandomStoragePath;
using ::curvefs::metaserver::storage::RocksDBStorage;
using ::curvefs::metaserver::storage::StorageOptions;

DECLARE_uint32(trash_expiredAfterSec);
DECLARE_uint32(trash_scanPeriodSec);

class TestTrash : public ::testing::Test {
protected:
void SetUp() override {
FLAGS_trash_scanPeriodSec = 1;
FLAGS_trash_expiredAfterSec = 1;
dataDir_ = RandomStoragePath();
StorageOptions options;
options.dataDir = dataDir_;
Expand Down Expand Up @@ -143,8 +148,6 @@ class TestTrash : public ::testing::Test {

TEST_F(TestTrash, testAdd3ItemAndDelete) {
TrashOption option;
option.scanPeriodSec = 1;
option.expiredAfterSec = 1;
option.mdsClient = std::make_shared<MockMdsClient>();
option.s3Adaptor = std::make_shared<MockS3ClientAdaptor>();
trashManager_->Init(option);
Expand Down Expand Up @@ -177,8 +180,6 @@ TEST_F(TestTrash, testAdd3ItemAndDelete) {

TEST_F(TestTrash, testAdd3ItemAndNoDelete) {
TrashOption option;
option.scanPeriodSec = 1;
option.expiredAfterSec = 1;
option.mdsClient = std::make_shared<MockMdsClient>();
option.s3Adaptor = std::make_shared<MockS3ClientAdaptor>();
trashManager_->Init(option);
Expand Down

0 comments on commit 61c8cbe

Please sign in to comment.