ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolai Kulagin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-8158) Missed cleanups if afterTestsStop throws exception
Date Thu, 23 Aug 2018 15:42:00 GMT

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

Nikolai Kulagin commented on 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
>
>         Attachments: StopAllGridsTest.java
>
>
> 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)

Mime
View raw message