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 more tests to ASSERT_STATUS_CHECKED (5) #7737

Closed
wants to merge 6 commits into from

Conversation

adamretter
Copy link
Collaborator

@adamretter adamretter commented Dec 2, 2020

Fifth batch of adding more tests to ASSERT_STATUS_CHECKED.

  • db_test
  • db_test2

Requires #7819 for all tests to pass.

Copy link
Contributor

@mrambacher mrambacher left a comment

Choose a reason for hiding this comment

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

Thanks for all of the hard work in this PR. That is quite a few places to check.

Generally, it is fine. Questions on what to do with status in a thread and where to check the status in the iterator -- I prefer as one of the "last" things or after a Valid() check.

db/db_test.cc Outdated Show resolved Hide resolved
Comment on lines -2303 to -2337
assert(versions);
assert(versions->GetColumnFamilySet());
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 saying if these changes are right or wrong (I prefer the latter) but I hit issues with similar changes with TSAN/ASAN before I think.

Copy link
Collaborator Author

@adamretter adamretter Dec 30, 2020

Choose a reason for hiding this comment

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

Hmm... I just wanted things to be consistent. It seems strange to sometimes use assert and at other times the GTest ASSERT* statements.

Copy link
Contributor

Choose a reason for hiding this comment

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

These apparently useless non-nullity checks are hints for clang-analyze not to generate false reports. I don't believe clang-analyze understands GTest ASSERT*. (I always recommend "why" comments where justification is not clear.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@pdillinger So should these be changed back? There are many changes like these in lots of tests - does that also then mean that we need to change these in all tests?

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider the CircleCI build-linux-clang10-clang-analyze to be authoritative. If it's happy, we should be good. (Hopefully our internal clang-analyze runs will agree with it; we can worry about any disagreements between the two as they happen.)

db/db_test.cc Outdated Show resolved Hide resolved
db/db_test.cc Outdated Show resolved Hide resolved
db/db_test.cc Outdated Show resolved Hide resolved
db/db_test2.cc Outdated Show resolved Hide resolved
db/db_test2.cc Outdated Show resolved Hide resolved
db/db_test2.cc Outdated Show resolved Hide resolved
table/block_fetcher.h Outdated Show resolved Hide resolved
trace_replay/trace_replay.cc Outdated Show resolved Hide resolved
@adamretter adamretter force-pushed the assert-status-checked-5 branch 2 times, most recently from f3e58e0 to adc01cd Compare January 9, 2021 18:00
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.

@akankshamahajan15
Copy link
Contributor

@adamretter DBTest.ThreadLocalPtrDeadlock is failing in ASAN check and ASSERT_STATUS_CHECKED.

@akankshamahajan15
Copy link
Contributor

@adamretter Hi Adam, were you able to resolve the failure?

@akankshamahajan15
Copy link
Contributor

@adamretter, Hi Adam. It's being a long time this PR has been in pending queue. Is there any update on this?

@adamretter
Copy link
Collaborator Author

adamretter commented Jun 22, 2021

Hi @akankshamahajan15 I rebased this PR this morning atop HEAD. I spent some time comparing and running the tests before and after rebase. Unfortunately after rebase (after resolving the merge conflicts) it now shows that there are several more failing tests than before, this is in part due to two things:

  1. new tests have been added to db_test and db_test2 since this original PR, and those tests do not pass ASC.
  2. changes have been made since this original PR, and those changes do not pass ASC (possibly because their tests were added to db_test and db_test2).

Is it best to push the rebased version of this PR and start resolving the new failures from here? Another option could be to split this PR into two, one for db_test and one for db_test2 as they are both quite large. What do you think? Let me know and I am happy to try and proceed.

p.s. the original issue DBTest.ThreadLocalPtrDeadlock failure still stands, but I could take another stab at it also.

@akankshamahajan15
Copy link
Contributor

Hi @akankshamahajan15 I rebased this PR this morning atop HEAD. I spent some time comparing and running the tests before and after rebase. Unfortunately after rebase (after resolving the merge conflicts) it now shows that there are several more failing tests than before, this is in part due to two things:

  1. new tests have been added to db_test and db_test2 since this original PR, and those tests do not pass ASC.
  2. changes have been made since this original PR, and those changes do not pass ASC (possibly because their tests were added to db_test and db_test2).

Is it best to push the rebased version of this PR and start resolving the new failures from here? Another option could be to split this PR into two, one for db_test and one for db_test2 as they are both quite large. What do you think? Let me know and I am happy to try and proceed.

p.s. the original issue DBTest.ThreadLocalPtrDeadlock failure still stands, but I could take another stab at it also.

Thanks a lot for taking it up. I think we If we can separate the two tests, we can atleast land one test otherwise more tests will keep getting added in future. Also we have techdebt week next week so let me know if you need any help. I can take a look at DBTest.ThreadLocalPtrDeadlock next week. It would be great if we can land this one.

@mrambacher
Copy link
Contributor

Hi @akankshamahajan15 I rebased this PR this morning atop HEAD. I spent some time comparing and running the tests before and after rebase. Unfortunately after rebase (after resolving the merge conflicts) it now shows that there are several more failing tests than before, this is in part due to two things:

  1. new tests have been added to db_test and db_test2 since this original PR, and those tests do not pass ASC.
  2. changes have been made since this original PR, and those changes do not pass ASC (possibly because their tests were added to db_test and db_test2).

Is it best to push the rebased version of this PR and start resolving the new failures from here? Another option could be to split this PR into two, one for db_test and one for db_test2 as they are both quite large. What do you think? Let me know and I am happy to try and proceed.
p.s. the original issue DBTest.ThreadLocalPtrDeadlock failure still stands, but I could take another stab at it also.

Thanks a lot for taking it up. I think we If we can separate the two tests, we can atleast land one test otherwise more tests will keep getting added in future. Also we have techdebt week next week so let me know if you need any help. I can take a look at DBTest.ThreadLocalPtrDeadlock next week. It would be great if we can land this one.

I am also willing to look into these next week, but would rather not re-invent the wheel. If we can get whatever is passing into master (without the ASC-okay flag), that would be great.

facebook-github-bot pushed a commit that referenced this pull request Aug 16, 2021
Summary:
This is the `db_test2` parts of #7737 reworked on the latest HEAD.

Pull Request resolved: #8640

Reviewed By: akankshamahajan15

Differential Revision: D30303684

Pulled By: mrambacher

fbshipit-source-id: 263e2f82d849bde4048b60aed8b31e7deed4706a
yoori pushed a commit to yoori/rocksdb that referenced this pull request Nov 26, 2023
Summary:
This is the `db_test2` parts of facebook/rocksdb#7737 reworked on the latest HEAD.

Pull Request resolved: facebook/rocksdb#8640

Reviewed By: akankshamahajan15

Differential Revision: D30303684

Pulled By: mrambacher

fbshipit-source-id: 263e2f82d849bde4048b60aed8b31e7deed4706a
This pull request was closed.
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.

5 participants