[ https://issues.apache.org/jira/browse/OOZIE-3408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16764823#comment-16764823 ]
Andras Salamon commented on OOZIE-3408: --------------------------------------- When I upscaled the unit tests in {{TestPurgeXCommand}} and used the "standard" way to insert jobs and action: {noformat} private void addRecordsToDB() throws Exception { jobs = new WorkflowJobBean[NUM]; actions = new WorkflowActionBean[NUM]; for (int i=0; i < NUM; ++i) { jobs[i] = addRecordToWfJobTable(WorkflowJob.Status.SUCCEEDED, WorkflowInstance.Status.SUCCEEDED); actions[i] = addRecordToWfActionTable(jobs[i].getId(), String.format("action%d", i), WorkflowAction.Status.OK); } }{noformat} and used a very simple test method: {noformat} public void testSucJobPurgeXCommand() throws Exception { addRecordsToDB(); new PurgeXCommand(WF_OLDER_THAN_7_DAYS, COORD_OLDER_THAN_1_DAY, BUNDLE_OLDER_THAN_1_DAY, LIMIT_10_ITEMS).call(); assertWorkflowJobsPurged(jobs); assertWorkflowActionsPurged(actions); } {noformat} The time for this test |record number|time| |1000|1 min 06s| |2000|1 min 32s| |5000|2 min 58s| |10000|5 min 13s| Most of the time is required for the record insertion. If I execute the test without purge and assert it takes 4:50 instead of 5:13. > Create new unit test class for PurgeXCommand > -------------------------------------------- > > Key: OOZIE-3408 > URL: https://issues.apache.org/jira/browse/OOZIE-3408 > Project: Oozie > Issue Type: Sub-task > Components: tests > Reporter: Andras Salamon > Assignee: Andras Salamon > Priority: Major > > There is one unit test class for {{PurgeXCommand}}, {{TestPurgeXCommand}} > which needs to be cleaned up. This class tests the selection of the purgeable > records. Most of the test cases are rather small, only a few workflows, > coordinators, bundles have to be checked. > It is also very important that purge service works correctly if large number > of records has to be checked. Purge service should not only select the > purgeable records correctly, it has to do that in a fast and memory efficient > ways. > Since {{TestPurgeXCommand}} is already very large, a new class should be > introduced to contain these tests. Probably the two classes will have a > common superclass. -- This message was sent by Atlassian JIRA (v7.6.3#76005)