You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/08/01 07:48:00 UTC

[jira] [Commented] (IGNITE-8158) Missed cleanups if afterTestsStop throws exception

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

ASF GitHub Bot commented on IGNITE-8158:
----------------------------------------

GitHub user zzzadruga opened a pull request:

    https://github.com/apache/ignite/pull/4464

    IGNITE-8158 Wrap the method afterTestsStopped() call with try/catch b…

    …lock

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zzzadruga/ignite IGNITE-8158

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ignite/pull/4464.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4464
    
----
commit 67adeb02efb776446075d1939cb3e08afbf36616
Author: zzzadruga <zz...@...>
Date:   2018-07-31T16:19:53Z

    IGNITE-8158 Wrap the method afterTestsStopped() call with try/catch block

----


> Missed cleanups if afterTestsStop throws exception
> --------------------------------------------------
>
>                 Key: IGNITE-8158
>                 URL: https://issues.apache.org/jira/browse/IGNITE-8158
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.4
>            Reporter: Maxim Muzafarov
>            Assignee: Nikolai Kulagin
>            Priority: Minor
>              Labels: newbie, test
>             Fix For: 2.7
>
>
> Method {{afterTestsStopped}} might throw exception. Contibutor should provide solution for ensuring that all cleanups in {{tearDown}} method would be executed in this case.
> {code:java|title=GridAbstractTest.java}
>     /** {@inheritDoc} */
>     @Override protected void tearDown() throws Exception {
>         ...
>         try {
>             afterTest();
>         }
>         finally {
>             serializedObj.clear();
>             if (isLastTest()) {
>                 ...
>                 afterTestsStopped();
>                 if (startGrid)
>                     G.stop(getTestIgniteInstanceName(), true);
>                 // Remove counters.
>                 tests.remove(getClass());
>                 // Remove resources cached in static, if any.
>                 GridClassLoaderCache.clear();
>                 U.clearClassCache();
>                 MarshallerExclusions.clearCache();
>                 BinaryEnumCache.clear();
>             }
>             Thread.currentThread().setContextClassLoader(clsLdr);
>             clsLdr = null;
>             cleanReferences();
>         }
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)