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

Support failpoints group #55

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Conversation

hunterlxt
Copy link
Member

@hunterlxt hunterlxt commented May 19, 2020

Let multiple tests run over different threads, meanwhile each configuration doesn't affect others.

  • expose FailPointRegistry as local registry.
  • pub fn create_registry() -> FailPointRegistry can get a new FailPointRegistry. So we can bound threads into exact one registry with register_current(&self) and deregister_current(&self).
  • add a test to show multiple threads don't affect each other.

close #51

@hunterlxt hunterlxt self-assigned this May 19, 2020
Signed-off-by: TXXT <[email protected]>
@hunterlxt hunterlxt requested a review from BusyJay May 20, 2020 07:06
@hunterlxt
Copy link
Member Author

hunterlxt commented May 20, 2020

I think all the tests need to be updated, It is better to test in the form of fail_points!. But I'm busy for special week now, and will continue to improve unit testing later.

@hunterlxt
Copy link
Member Author

@BusyJay I think this PR is ready PTAL

@hunterlxt hunterlxt force-pushed the XT/threads branch 2 times, most recently from 08942e2 to 86f06ca Compare May 26, 2020 08:47
@zhangjinpeng87
Copy link
Member

@NingLin-P PTAL

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
NingLin-P
NingLin-P previously approved these changes Jun 1, 2020
Signed-off-by: Xintao <[email protected]>
src/lib.rs Outdated Show resolved Hide resolved
Signed-off-by: Xintao <[email protected]>
src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@BusyJay BusyJay left a comment

Choose a reason for hiding this comment

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

I suggest to use the patch inside TiKV if the interfaces are good enough to write clean code. As far as what I can see, it's hard to build thread group without a FailPointRegistry::current method.

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
Signed-off-by: Xintao <[email protected]>
@hunterlxt
Copy link
Member Author

This PR is staled for about a week

@BusyJay
Copy link
Member

BusyJay commented Jun 8, 2020

So have you tried to use it in TiKV? Is everything working well?

@hunterlxt
Copy link
Member Author

hunterlxt commented Jun 9, 2020

tikv/tikv#8065 @BusyJay

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
Signed-off-by: Xintao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support thread group
4 participants