-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Add tests in ASSERT_STATUS_CHECKED #7793
Conversation
trace_replay/io_tracer.cc
Outdated
@@ -216,13 +216,21 @@ void IOTracer::EndIOTrace() { | |||
} | |||
|
|||
Status IOTracer::WriteIOOp(const IOTraceRecord& record) { | |||
Status s; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Makefile
Outdated
io_tracer_test \ | ||
merge_helper_test \ | ||
io_tracer_parser_test \ | ||
prefetch_test \ | ||
merge_helper_test \ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2078b52
to
2da034f
Compare
There was a problem hiding this 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.
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
Updated the code to change return type to Void in |
357889a
to
053086d
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
053086d
to
ce3efac
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
There was a problem hiding this 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:
ce3efac
to
6cafe37
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
There was a problem hiding this 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.
@akankshamahajan15 merged this pull request in fbac1b3. |
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
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>
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>
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>
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>
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: