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

[ISSUE #11951] Fix the problem that the servicename and groupname are not resolved correctly when deleting an empty service instance #11955

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

Happy-26
Copy link
Contributor

@Happy-26 Happy-26 commented Apr 11, 2024

Bug fix #11951 修改删除空服务实例时,服务名和分组名没有正确解析的问题

@Happy-26 Happy-26 changed the title bug fix #11951 : [ISSUE # 11951] Fix the problem that the servicename and groupname are not resolved correctly when deleting an empty service instance Apr 11, 2024
@Happy-26 Happy-26 changed the title [ISSUE # 11951] Fix the problem that the servicename and groupname are not resolved correctly when deleting an empty service instance [ISSUE #11951] Fix the problem that the servicename and groupname are not resolved correctly when deleting an empty service instance Apr 11, 2024
Copy link
Collaborator

@KomachiSion KomachiSion left a comment

Choose a reason for hiding this comment

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

Can you help community to add unit test for this case?

@Happy-26
Copy link
Contributor Author

Happy-26 commented Apr 12, 2024

It seems that a unit test already exists here:ServiceControllerTest

@KomachiSion
Copy link
Collaborator

It seems that a unit test already exists here:ServiceControllerTest

Yes I know it, I mean the old one only check the UpdateServiceTraceEvent , not check DeregisterServiceTraceEvent

@KomachiSion
Copy link
Collaborator

KomachiSion commented Apr 12, 2024

It seems that a unit test already exists here:ServiceControllerTest

Yes I know it, I mean the old one only check the UpdateServiceTraceEvent , not check DeregisterServiceTraceEvent

Prefer you add the check for DeregisterServiceTraceEvent in UT.

@Happy-26
Copy link
Contributor Author

It seems that a unit test already exists here:ServiceControllerTest

Yes I know it, I mean the old one only check the UpdateServiceTraceEvent , not check DeregisterServiceTraceEvent

Prefer you add the check for DeregisterServiceTraceEvent in UT.

I'm sorry I didn't understand how to write unit tests for Nacos. Do you mean to change it to this?

@Before
public void before() {
    super.before();
    subscriber = new SmartSubscriber() {
        @Override
        public List<Class<? extends Event>> subscribeTypes() {
            List<Class<? extends Event>> result = new LinkedList<>();
            result.add(UpdateServiceTraceEvent.class);
            result.add(DeregisterServiceTraceEvent.class);
            return result;
        }
        
        @Override
        public void onEvent(Event event) {
            eventReceivedClass = event.getClass();
        }
    };
    NotifyCenter.registerSubscriber(subscriber);
}

@After
public void tearDown() throws Exception {
    NotifyCenter.deregisterSubscriber(subscriber);
    NotifyCenter.deregisterPublisher(UpdateServiceTraceEvent.class);
    NotifyCenter.deregisterPublisher(DeregisterServiceTraceEvent.class);
    eventReceivedClass = null;
}

@KomachiSion KomachiSion merged commit 2005ca6 into alibaba:develop Apr 15, 2024
7 checks passed
@KomachiSion KomachiSion added the kind/bug Category issues or prs related to bug. label Apr 15, 2024
@KomachiSion KomachiSion added this to the 2.4.0 milestone Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

删除空服务时,发布DeregisterServiceTraceEvent 传参错误
2 participants