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

remove path from failpoint #44

Merged
merged 1 commit into from
Dec 9, 2022
Merged

Conversation

lavacat
Copy link

@lavacat lavacat commented Dec 4, 2022

@lavacat lavacat marked this pull request as draft December 4, 2022 20:23
@serathius
Copy link
Member

This looks good for me. cc @ahrtr who had different opinion about the topic.
Can you fix the DCO check? Just run git checkout dd4869804163318da0745652c38501072f3c824d && git commit --amend --signoff && git push HEAD:remove-fp-path -f

@ahrtr
Copy link
Member

ahrtr commented Dec 6, 2022

cc @ahrtr who had different opinion about the topic.

Just as I mentioned in etcd-io/etcd#14727 (comment), it isn't a big deal. Since no feedback from other maintainers. I don't want to be blocked here. I agree to remove the pacakge path, although personally I tend to keep it.

runtime/runtime.go Show resolved Hide resolved
runtime/runtime.go Outdated Show resolved Hide resolved
@ahrtr
Copy link
Member

ahrtr commented Dec 6, 2022

We don't have e2e test for now, please make sure you manually verify the PR using examples

@serathius
Copy link
Member

@lavacat Can you apply the suggestions by @ahrtr ?

@lavacat
Copy link
Author

lavacat commented Dec 8, 2022

We don't have e2e test for now, please make sure you manually verify the PR using examples

Tried using examples.

./gofail enable examples
GOFAIL_FAILPOINTS="ExampleLabels=sleep(100)" go run examples/cmd/cmd.go

Also tried same fail point in 2 different packages to test warning.

None of the existing unit tests failed after the change, so I'm looking if I can add unit test.

@lavacat lavacat force-pushed the remove-fp-path branch 2 times, most recently from f443741 to bf96b6f Compare December 8, 2022 09:20
@lavacat lavacat marked this pull request as ready for review December 8, 2022 09:21
@lavacat
Copy link
Author

lavacat commented Dec 8, 2022

  • added unit tests
  • renamed failpath to name everywhere in runtime.go

@ahrtr FYI with your suggestion there was a deadlock, because register was calling Enable that acquires the same lock. Changed it to call enable. I think that was a typo in original code.

@lavacat
Copy link
Author

lavacat commented Dec 8, 2022

  • changed NewFailpoint/register logic to return existing failpoint if name is already registered
  • updated readme
  • minor unit tests improvements
    @serathius @ahrtr I think this is ready to merge. Please take a look.

runtime/runtime.go Outdated Show resolved Hide resolved
@ahrtr
Copy link
Member

ahrtr commented Dec 8, 2022

Overall looks good to me with two comments:

  1. Please fix the test failure;
  2. Please consider using github.com/stretchr/testify in the unit test so simplify the implementation.

@lavacat
Copy link
Author

lavacat commented Dec 9, 2022

Overall looks good to me with two comments:

  1. Please fix the test failure;
  2. Please consider using github.com/stretchr/testify in the unit test so simplify the implementation.

@ahrtr thanks, addressed both

code/binding_test.go Outdated Show resolved Hide resolved
runtime/failpoint_test.go Outdated Show resolved Hide resolved
runtime/runtime.go Outdated Show resolved Hide resolved
Signed-off-by: Bogdan Kanivets <bkanivets@apple.com>
Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you @lavacat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants