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

Add tests in ASSERT_STATUS_CHECKED #7793

Conversation

akankshamahajan15
Copy link
Contributor

Summary: add io_tracer_parser_test and prefetch_test under
ASSERT_STATUS_CHECKED

Test Plan: ASSERT_STATUS_CHECKED=1 make check -j64

Reviewers:

Subscribers:

Tasks:

Tags:

@@ -216,13 +216,21 @@ void IOTracer::EndIOTrace() {
}

Status IOTracer::WriteIOOp(const IOTraceRecord& record) {
Status s;
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure I understand the need for any of the changes in this method. This method looks like it should have passed the ASC without these changes. Can you revert them and tell me what test is failing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

io_tracer_parser_test fails because currently, I am ignoring the status of IOTracer::WriteIOOp in file_system_tracer.cc. I am planning to either log or return that status but haven't figured it out what to do with status. I added TODO as well. Planning to work on this in next half with few more additions related to io_tracer.

Copy link
Contributor

Choose a reason for hiding this comment

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

interesting. I wonder if this approach relies on return-value optimization. I'd expect if a different Status were constructed in the client with the result, that one would be unchecked.

Copy link
Contributor

@ajkr ajkr Dec 21, 2020

Choose a reason for hiding this comment

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

Confirmed that is the case. This is likely not the only test that is optimization-dependent (I've run DEBUG_LEVEL=2 ASSERT_STATUS_CHECKED=1 before and seen other failures), but it'd be good to fix still. Can we call PermitUncheckedError() in the clients instead of inside the function returning the Status?

$ make clean && ASSERT_STATUS_CHECKED=1 EXTRA_CXXFLAGS="-fno-elide-constructors" make -j48 io_tracer_parser_test
$ ./io_tracer_parser_test
[==========] Running 4 tests from 1 test case.                                                                                                                                                                                        [2/1853]
[----------] Global test environment set-up.
[----------] 4 tests from IOTracerParserTest
[ RUN      ] IOTracerParserTest.InvalidArguments
Failed to check Status 0x7ffe392aa5b0
#0   ./io_tracer_parser_test() [0x69fc3f] rocksdb::port::PrintStack(int)        /data/users/andrewkr/rocksdb/port/stack_trace.cc:121
#1   ./io_tracer_parser_test() [0x470a39] rocksdb::Status::~Status()    /data/users/andrewkr/rocksdb/./include/rocksdb/status.h:42
#2   ./io_tracer_parser_test() [0x510135] rocksdb::SanitizeOptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rocksdb::DBOptions const&)   /data/users/andrewkr/rocksdb/db/db_impl/db_impl_open.cc:166 (discriminator 1)
#3   ./io_tracer_parser_test() [0x4c4392] rocksdb::DBImpl::DBImpl(rocksdb::DBOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool)        /data/users/andrewkr/rocksdb/db/db_impl/db_impl.cc:153
#4   ./io_tracer_parser_test() [0x512b0e] rocksdb::DBImpl::Open(rocksdb::DBOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<rocksdb::ColumnFamilyDescriptor, std::allocator<rocksdb::ColumnFamilyDescriptor> > const&, std::vector<ro      ksdb::ColumnFamilyHandle*, std::allocator<rocksdb::ColumnFamilyHandle*> >*, rocksdb::DB**, bool, bool)  /data/users/andrewkr/rocksdb/db/db_impl/db_impl_open.cc:1519
#5   ./io_tracer_parser_test() [0x514a98] rocksdb::DB::Open(rocksdb::DBOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<rocksdb::ColumnFamilyDescriptor, std::allocator<rocksdb::ColumnFamilyDescriptor> > const&, std::vector<rocksd      ::ColumnFamilyHandle*, std::allocator<rocksdb::ColumnFamilyHandle*> >*, rocksdb::DB**)  /data/users/andrewkr/rocksdb/db/db_impl/db_impl_open.cc:1450
#6   ./io_tracer_parser_test() [0x514c98] rocksdb::DB::Open(rocksdb::Options const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rocksdb::DB**)     /data/users/andrewkr/rocksdb/db/db_impl/db_impl_open.cc:1428
#7   ./io_tracer_parser_test() [0x4746a7] rocksdb::IOTracerParserTest::IOTracerParserTest()     /data/users/andrewkr/rocksdb/tools/io_tracer_parser_test.cc:42
#8   ./io_tracer_parser_test() [0x47599b] rocksdb::IOTracerParserTest_InvalidArguments_Test::IOTracerParserTest_InvalidArguments_Test() /data/users/andrewkr/rocksdb/tools/io_tracer_parser_test.cc:108
#9   ./io_tracer_parser_test() [0x4a4e3d] testing::Test* testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::TestFactoryBase, testing::Test*>(testing::internal::TestFactoryBase*, testing::Test* (testing::internal::TestFactoryBase::*)(), char const*)    /data/users/andrewkr/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/gtest-all.cc:3899
...

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually the above failure I showed is indeed a different optimization-dependent Status check. I guess there is a whole project to be done to get rid of optimization dependencies. Please feel free to go ahead then and not block on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ajkr I will be submitting a separate PR shortly that addresses the "-fno-elide-constructors".

Copy link
Contributor

@jay-zhuang jay-zhuang left a comment

Choose a reason for hiding this comment

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

LGTM.

Makefile Outdated
Comment on lines 680 to 683
io_tracer_test \
merge_helper_test \
io_tracer_parser_test \
prefetch_test \
merge_helper_test \
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: change the spaces to tabs

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@akankshamahajan15 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

@akankshamahajan15
Copy link
Contributor Author

Updated the code to change return type to Void in IOTracer::WriteIOOp and later on handle the status of IOTracer::WriteIOOp in future.

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@akankshamahajan15 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Summary: add io_tracer_parser_test and prefetch_test under
ASSERT_STATUS_CHECKED

Test Plan: ASSERT_STATUS_CHECKED=1 make check -j64

Reviewers:

Subscribers:

Tasks:

Tags:
@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@akankshamahajan15 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 merged this pull request in fbac1b3.

codingrhythm pushed a commit to SafetyCulture/rocksdb that referenced this pull request Mar 5, 2021
Summary:
add io_tracer_parser_test and prefetch_test under
ASSERT_STATUS_CHECKED

Pull Request resolved: facebook#7793

Test Plan: ASSERT_STATUS_CHECKED=1 make check -j64

Reviewed By: jay-zhuang

Differential Revision: D25673464

Pulled By: akankshamahajan15

fbshipit-source-id: 50e0b6f17160ddda206a521a7b47ee33e699a2d4
levichen94 pushed a commit to bytedance/terarkdb that referenced this pull request Jun 18, 2021
Summary:
add io_tracer_parser_test and prefetch_test under
ASSERT_STATUS_CHECKED

Pull Request resolved: facebook/rocksdb#7793

Test Plan: ASSERT_STATUS_CHECKED=1 make check -j64

Reviewed By: jay-zhuang

Differential Revision: D25673464

Pulled By: akankshamahajan15

fbshipit-source-id: 50e0b6f17160ddda206a521a7b47ee33e699a2d4
Signed-off-by: Changlong Chen <levisonchen@live.cn>
levichen94 pushed a commit to bytedance/terarkdb that referenced this pull request Jun 18, 2021
Summary:
add io_tracer_parser_test and prefetch_test under
ASSERT_STATUS_CHECKED

Pull Request resolved: facebook/rocksdb#7793

Test Plan: ASSERT_STATUS_CHECKED=1 make check -j64

Reviewed By: jay-zhuang

Differential Revision: D25673464

Pulled By: akankshamahajan15

fbshipit-source-id: 50e0b6f17160ddda206a521a7b47ee33e699a2d4
Signed-off-by: Changlong Chen <levisonchen@live.cn>
mm304321141 pushed a commit to bytedance/terarkdb that referenced this pull request Jun 23, 2021
Summary:
add io_tracer_parser_test and prefetch_test under
ASSERT_STATUS_CHECKED

Pull Request resolved: facebook/rocksdb#7793

Test Plan: ASSERT_STATUS_CHECKED=1 make check -j64

Reviewed By: jay-zhuang

Differential Revision: D25673464

Pulled By: akankshamahajan15

fbshipit-source-id: 50e0b6f17160ddda206a521a7b47ee33e699a2d4
Signed-off-by: Changlong Chen <levisonchen@live.cn>
mm304321141 pushed a commit to bytedance/terarkdb that referenced this pull request Jun 23, 2021
Summary:
add io_tracer_parser_test and prefetch_test under
ASSERT_STATUS_CHECKED

Pull Request resolved: facebook/rocksdb#7793

Test Plan: ASSERT_STATUS_CHECKED=1 make check -j64

Reviewed By: jay-zhuang

Differential Revision: D25673464

Pulled By: akankshamahajan15

fbshipit-source-id: 50e0b6f17160ddda206a521a7b47ee33e699a2d4
Signed-off-by: Changlong Chen <levisonchen@live.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants