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

test: add the necessary judgment #9694

Merged
merged 2 commits into from Aug 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/test/libcephfs/access.cc
Expand Up @@ -368,8 +368,14 @@ int main(int argc, char **argv)

srand(getpid());

rados_create(&cluster, NULL);
rados_conf_read_file(cluster, NULL);
r = rados_create(&cluster, NULL);
if (r < 0)
exit(1);

r = rados_conf_read_file(cluster, NULL);
if (r < 0)
exit(1);

rados_conf_parse_env(cluster, NULL);
r = rados_connect(cluster);
if (r < 0)
Expand Down
12 changes: 6 additions & 6 deletions src/test/librados/io.cc
Expand Up @@ -50,12 +50,12 @@ TEST_F(LibRadosIo, ReadTimeout) {
// set up a second client
rados_t cluster;
rados_ioctx_t ioctx;
rados_create(&cluster, "admin");
rados_conf_read_file(cluster, NULL);
rados_conf_parse_env(cluster, NULL);
rados_conf_set(cluster, "rados_osd_op_timeout", "0.00001"); // use any small value that will result in a timeout
rados_connect(cluster);
rados_ioctx_create(cluster, pool_name.c_str(), &ioctx);
ASSERT_EQ(0, rados_create(&cluster, "admin"));
ASSERT_EQ(0, rados_conf_read_file(cluster, NULL));
ASSERT_EQ(0, rados_conf_parse_env(cluster, NULL));
ASSERT_EQ(0, rados_conf_set(cluster, "rados_osd_op_timeout", "0.00001")); // use any small value that will result in a timeout
ASSERT_NE(0, rados_connect(cluster));
Copy link
Member

Choose a reason for hiding this comment

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

this should succeed - rados_osd_op_timeout only applies to OSD ops (like the read checked below), not the initial connection

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks
I missing, change it

Copy link
Contributor

Choose a reason for hiding this comment

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

@renhwztetecs. seems we still have this change? see http://tracker.ceph.com/issues/17087

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed by #10806

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am sure I modified it,I don't know what happened
But thank you to fixup it

ASSERT_EQ(0, rados_ioctx_create(cluster, pool_name.c_str(), &ioctx));
rados_ioctx_set_namespace(ioctx, nspace.c_str());

// then we show that the buffer is changed after rados_read returned
Expand Down