[ 
https://issues.apache.org/jira/browse/IGNITE-28243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18066761#comment-18066761
 ] 

Ignite TC Bot commented on IGNITE-28243:
----------------------------------------

{panel:title=Branch: [pull/12910/head] Base: [master] : No blockers 
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
{panel:title=Branch: [pull/12910/head] Base: [master] : New Tests 
(2)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}
{color:#00008b}Service Grid{color} [[tests 
2|https://ci2.ignite.apache.org/viewLog.html?buildId=8940837]]
* {color:#013220}IgniteServiceGridTestSuite: 
IgniteServiceDeployOnJoinedNodeTest.test[nodeBClient=false] - PASSED{color}
* {color:#013220}IgniteServiceGridTestSuite: 
IgniteServiceDeployOnJoinedNodeTest.test[nodeBClient=true] - PASSED{color}

{panel}
[TeamCity *--> Run :: All* 
Results|https://ci2.ignite.apache.org/viewLog.html?buildId=8940870&buildTypeId=IgniteTests24Java8_RunAll]

> Error on deployed service invocation
> ------------------------------------
>
>                 Key: IGNITE-28243
>                 URL: https://issues.apache.org/jira/browse/IGNITE-28243
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Nikolay Izhikov
>            Assignee: Nikolay Izhikov
>            Priority: Major
>              Labels: ise
>             Fix For: 2.18
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {noformat:java}
> package sandbox.ignite;
> import org.apache.ignite.Ignition;
> import org.apache.ignite.cluster.ClusterNode;
> import org.apache.ignite.configuration.IgniteConfiguration;
> import org.apache.ignite.lang.IgnitePredicate;
> import org.apache.ignite.services.Service;
> import org.apache.ignite.services.ServiceConfiguration;
> import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
> import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
> import org.junit.jupiter.api.Test;
> import java.util.Collections;
> import static org.junit.jupiter.api.Assertions.assertEquals;
> /**
>  * Проблемы перехода с Ignite SE 16.1.1 на 17.0.0
>  * (задача <a 
> href="https://jira.sberbank.ru/browse/CFALL-35713";>CFALL-35713</a>).
>  */
> public class CfAll35713Test {
>     private static final String SERVICE_NODE_NAME = "serviceNode";
>     /**
>      * Сервисный узел получает свой сервис из кластера при присоединении к 
> кластеру.
>      */
>     @Test
>     public void nodeGetsServiceFromCluster() throws InterruptedException {
>         // Имеем кластер, в конфигурации которого задан сервис, который 
> должен быть развёрнут только на узле c ID
>         // "serviceNode". serviceNode пока не в кластере.
>         final var serviceName = Greeter.class.getSimpleName();
>         final var serviceConfig = new ServiceConfiguration()
>             .setName(serviceName)
>             .setService(new GreeterService())
>             .setMaxPerNodeCount(1)
>             .setNodeFilter(new ServiceNodeFilter());
>         final var serverNodeConfig = 
> getIgniteConfiguration("serverNode").setServiceConfiguration(serviceConfig);
>         try (final var ignored = Ignition.start(serverNodeConfig)) {
>             // Когда serviceNode с пустой конфигурацией входит в кластер
>             final var serviceNodeConfig = 
> getIgniteConfiguration(SERVICE_NODE_NAME).setClientMode(true);
>             try (final var serviceNode = Ignition.start(serviceNodeConfig)) {
>                 // И через некоторое время (в реальности порядка 30 секунд) 
> после входа вызывает сервис
>                 Thread.sleep(2_000);
>                 final var localNode = serviceNode.cluster().forLocal();
>                 final var greeter = 
> serviceNode.services(localNode).serviceProxy(serviceName, Greeter.class, 
> false);
>                 final var result = greeter.greet();
>                 // Тогда:
>                 // Ожидаемый и фактический результат на Ignite SE 16.1.3: 
> вызов проходит успешно
>                 // Фактический результат на Ignite SE 17.0.0: 
> IgniteException: Failed to find deployed service: Greeter
>                 assertEquals("Hello", result);
>             }
>         }
>     }
>     private static IgniteConfiguration getIgniteConfiguration(final String 
> igniteName) {
>         return new IgniteConfiguration()
>             .setIgniteInstanceName(igniteName)
>             .setConsistentId(igniteName)
>             .setFailureDetectionTimeout(600_000)
>             .setClientFailureDetectionTimeout(600_000)
>             .setDiscoverySpi(
>                 new TcpDiscoverySpi()
>                     .setIpFinder(new 
> TcpDiscoveryVmIpFinder().setAddresses(Collections.singleton("127.0.0.1:49500")))
>                     .setLocalPort(49500));
>     }
>     public interface Greeter {
>         String greet();
>     }
>     private static class GreeterService implements Greeter, Service {
>         @Override
>         public String greet() {
>             return "Hello";
>         }
>     }
>     public static class ServiceNodeFilter implements 
> IgnitePredicate<ClusterNode> {
>         @Override
>         public boolean apply(ClusterNode clusterNode) {
>             return SERVICE_NODE_NAME.equals(clusterNode.consistentId());
>         }
>     }
> }
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to