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

Ruslan Ostafiychuk commented on FALCON-587:
-------------------------------------------

{quote}
During one of the discussion we had decided that BaseTestClass will not have 
any @AfterClass, @BeforeClass or other tags.
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/merlin-falconqa/04_kyMhDq4c/MAe0k8bCtKsJ

To reiterate an example where this can lead to problems.

we create test data as user1
switch to user2 for testing
@AfterClass tagged method cleanTestDirs is called. Since, the curret user is 
user2 - this will fail.

The basic issue is that there is no gurantees as the order in which @AfterClass 
tagged methods will called. So, we had decided that we will keep all the tagged 
methods in child/test classes. And not use them in BaseTestClass. We also 
followed this for removeBundles() method.
{quote}

If we switch user for testing we always switch it back in @AfterMethod. We also 
can add switching for default user in cleanTestDirs().
@AfterMethod tagged methods are called before any @AfterClass tagged methods.
We have only one test class with @AfterClass tagged method which call 
closeBrowser() and removeBundles() methods. These methods can be called before 
and after folder deletion without any problems.

> Don't delete input data in @AfterClass in falcon-regression tests
> -----------------------------------------------------------------
>
>                 Key: FALCON-587
>                 URL: https://issues.apache.org/jira/browse/FALCON-587
>             Project: Falcon
>          Issue Type: Bug
>          Components: merlin
>            Reporter: Ruslan Ostafiychuk
>            Priority: Minor
>         Attachments: FALCON-587.patch, FALCON-587_v2.patch, 
> FALCON-587_v3.patch
>
>
> We can leave input data after tests for debug. Input data will be deleted if 
> we run tests again in @BeforeMethod (during 
> HadoopUtil.flattenAndPutDataInFolder()).



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to