You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladislav Novikov (Jira)" <ji...@apache.org> on 2024/10/28 09:21:00 UTC

[jira] [Assigned] (IGNITE-23226) Services: deployment failed but service descriptor stay

     [ https://issues.apache.org/jira/browse/IGNITE-23226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vladislav Novikov reassigned IGNITE-23226:
------------------------------------------

    Assignee: Vladislav Novikov

> Services: deployment failed but service descriptor stay
> -------------------------------------------------------
>
>                 Key: IGNITE-23226
>                 URL: https://issues.apache.org/jira/browse/IGNITE-23226
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Nikolay Izhikov
>            Assignee: Vladislav Novikov
>            Priority: Minor
>              Labels: ise
>
> In case service failed to deploy {{Ignite.services().serviceDescriptors().isEmpty() == false}}.
> {code:java}
> public class IgniteServiceDeployUnknownClassTest extends GridCommonAbstractTest {
>     /** */
>     private static final String NOOP_SERVICE_CLS_NAME = "org.apache.ignite.tests.p2p.NoopService";
>     /** */
>     public static final String NODE_FILTER_CLS_NAME = "org.apache.ignite.tests.p2p.ExcludeNodeFilter";
>     /** */
>     private static ClassLoader extClsLdr;
>     /** {@inheritDoc} */
>     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
>         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
>         cfg.setPeerClassLoadingEnabled(false);
>         cfg.setFailureHandler(new StopNodeFailureHandler());
>         return cfg;
>     }
>     /** {@inheritDoc} */
>     @Override protected void beforeTest() throws Exception {
>         super.beforeTest();
>         extClsLdr = getExternalClassLoader();
>     }
>     /** {@inheritDoc} */
>     @Override protected void afterTest() throws Exception {
>         stopAllGrids();
>         super.afterTest();
>         extClsLdr = null;
>     }
>     /** @throws Exception If failed. */
>     @Test
>     public void testFailWhenClassNotFound() throws Exception {
>         IgniteEx srv = startGrid(getConfiguration("server"));
>         IgniteEx cli = startClientGrid(1);
>         ServiceConfiguration svcCfg = new ServiceConfiguration()
>             .setName("TestDeploymentService")
>             .setService(((Class<Service>)extClsLdr.loadClass(NOOP_SERVICE_CLS_NAME)).getDeclaredConstructor().newInstance())
>             .setNodeFilter(((Class<IgnitePredicate<ClusterNode>>)extClsLdr.loadClass(NODE_FILTER_CLS_NAME))
>                 .getConstructor(UUID.class)
>                 .newInstance(cli.configuration().getNodeId()))
>             .setTotalCount(1);
>         assertThrowsWithCause(() -> cli.services().deploy(svcCfg), ServiceDeploymentException.class);
>         assertTrue(cli.services().serviceDescriptors().isEmpty());
>     }
> }
> {code}



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