You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by tu...@apache.org on 2012/08/22 03:14:46 UTC
svn commit: r1375868 - in /incubator/oozie/trunk: ./
core/src/test/java/org/apache/oozie/action/hadoop/
core/src/test/java/org/apache/oozie/action/ssh/
core/src/test/java/org/apache/oozie/command/
core/src/test/java/org/apache/oozie/command/bundle/ cor...
Author: tucu
Date: Wed Aug 22 01:14:45 2012
New Revision: 1375868
URL: http://svn.apache.org/viewvc?rev=1375868&view=rev
Log:
OOZIE-957 TestStatusTransitService and TestCoordKillXCommand are failing randomly; replace Thread.sleep() (rkanter via tucu)
Modified:
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestLauncher.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestPigActionExecutor.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestShellActionExecutor.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/ssh/TestSshActionExecutor.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/TestXCommand.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleJobSuspendXCommand.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleKillXCommand.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleStartXCommand.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestLastModified.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestReRunXCommand.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestWorkflowKillXCommand.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestWorkflowActionsRunningGetJPAExecutor.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestActionCheckerService.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestCoordMaterializeTriggerService.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestPurgeService.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestStatusTransitService.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestXLogService.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/store/TestDBWorkflowStore.java
incubator/oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java
incubator/oozie/trunk/release-log.txt
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestLauncher.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestLauncher.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestLauncher.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestLauncher.java Wed Aug 22 01:14:45 2012
@@ -106,8 +106,13 @@ public class TestLauncher extends XFsTes
public void testEmpty() throws Exception {
Path actionDir = getFsTestCaseDir();
FileSystem fs = getFileSystem();
- RunningJob runningJob = _test();
- Thread.sleep(2000);
+ final RunningJob runningJob = _test();
+ waitFor(2000, new Predicate() {
+ @Override
+ public boolean evaluate() throws Exception {
+ return runningJob.isComplete();
+ }
+ });
assertTrue(runningJob.isSuccessful());
assertTrue(LauncherMapper.isMainDone(runningJob));
@@ -123,8 +128,13 @@ public class TestLauncher extends XFsTes
public void testExit0() throws Exception {
Path actionDir = getFsTestCaseDir();
FileSystem fs = getFileSystem();
- RunningJob runningJob = _test("exit0");
- Thread.sleep(2000);
+ final RunningJob runningJob = _test("exit0");
+ waitFor(2000, new Predicate() {
+ @Override
+ public boolean evaluate() throws Exception {
+ return runningJob.isComplete();
+ }
+ });
assertTrue(runningJob.isSuccessful());
assertTrue(LauncherMapper.isMainDone(runningJob));
@@ -140,8 +150,13 @@ public class TestLauncher extends XFsTes
public void testExit1() throws Exception {
Path actionDir = getFsTestCaseDir();
FileSystem fs = getFileSystem();
- RunningJob runningJob = _test("exit1");
- Thread.sleep(2000);
+ final RunningJob runningJob = _test("exit1");
+ waitFor(2000, new Predicate() {
+ @Override
+ public boolean evaluate() throws Exception {
+ return runningJob.isComplete();
+ }
+ });
assertTrue(runningJob.isSuccessful());
assertTrue(LauncherMapper.isMainDone(runningJob));
@@ -157,8 +172,13 @@ public class TestLauncher extends XFsTes
public void testException() throws Exception {
Path actionDir = getFsTestCaseDir();
FileSystem fs = getFileSystem();
- RunningJob runningJob = _test("ex");
- Thread.sleep(2000);
+ final RunningJob runningJob = _test("ex");
+ waitFor(2000, new Predicate() {
+ @Override
+ public boolean evaluate() throws Exception {
+ return runningJob.isComplete();
+ }
+ });
assertTrue(runningJob.isSuccessful());
assertTrue(LauncherMapper.isMainDone(runningJob));
@@ -174,8 +194,13 @@ public class TestLauncher extends XFsTes
public void testOutput() throws Exception {
Path actionDir = getFsTestCaseDir();
FileSystem fs = getFileSystem();
- RunningJob runningJob = _test("out");
- Thread.sleep(2000);
+ final RunningJob runningJob = _test("out");
+ waitFor(2000, new Predicate() {
+ @Override
+ public boolean evaluate() throws Exception {
+ return runningJob.isComplete();
+ }
+ });
assertTrue(runningJob.isSuccessful());
assertTrue(LauncherMapper.isMainDone(runningJob));
@@ -191,8 +216,13 @@ public class TestLauncher extends XFsTes
public void testNewId() throws Exception {
Path actionDir = getFsTestCaseDir();
FileSystem fs = getFileSystem();
- RunningJob runningJob = _test("id");
- Thread.sleep(2000);
+ final RunningJob runningJob = _test("id");
+ waitFor(2000, new Predicate() {
+ @Override
+ public boolean evaluate() throws Exception {
+ return runningJob.isComplete();
+ }
+ });
assertTrue(runningJob.isSuccessful());
assertTrue(LauncherMapper.isMainDone(runningJob));
@@ -208,8 +238,13 @@ public class TestLauncher extends XFsTes
public void testSecurityManager() throws Exception {
Path actionDir = getFsTestCaseDir();
FileSystem fs = getFileSystem();
- RunningJob runningJob = _test("securityManager");
- Thread.sleep(2000);
+ final RunningJob runningJob = _test("securityManager");
+ waitFor(2000, new Predicate() {
+ @Override
+ public boolean evaluate() throws Exception {
+ return runningJob.isComplete();
+ }
+ });
assertTrue(runningJob.isSuccessful());
assertTrue(LauncherMapper.isMainDone(runningJob));
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestPigActionExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestPigActionExecutor.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestPigActionExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestPigActionExecutor.java Wed Aug 22 01:14:45 2012
@@ -187,7 +187,7 @@ public class TestPigActionExecutor exten
evaluateLauncherJob(launcherJob);
assertTrue(launcherJob.isSuccessful());
- Thread.sleep(2000);
+ sleep(2000);
assertFalse(LauncherMapper.hasIdSwap(launcherJob));
if (checkForSuccess) {
assertTrue(LauncherMapper.hasStatsData(launcherJob));
@@ -328,7 +328,7 @@ public class TestPigActionExecutor exten
return launcherJob.isComplete();
}
});
- Thread.sleep(2000);
+ sleep(2000);
}
protected XConfiguration setPigConfig(boolean writeStats) {
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestShellActionExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestShellActionExecutor.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestShellActionExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/hadoop/TestShellActionExecutor.java Wed Aug 22 01:14:45 2012
@@ -245,7 +245,7 @@ public class TestShellActionExecutor ext
// Thread.sleep(2000);
assertTrue(launcherJob.isSuccessful());
- Thread.sleep(2000);// Wait more to make sure no ID swap happens
+ sleep(2000);// Wait more to make sure no ID swap happens
assertFalse(LauncherMapper.hasIdSwap(launcherJob));
ShellActionExecutor ae = new ShellActionExecutor();
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/ssh/TestSshActionExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/ssh/TestSshActionExecutor.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/ssh/TestSshActionExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/action/ssh/TestSshActionExecutor.java Wed Aug 22 01:14:45 2012
@@ -232,7 +232,7 @@ public class TestSshActionExecutor exten
final Context context = new Context(workflow, action);
ssh.start(context, action);
- Thread.sleep(200);
+ sleep(200);
final WorkflowActionBean action1 = new WorkflowActionBean();
action1.setId("actionId");
action1.setConf("<ssh xmlns='" + getActionXMLSchema() + "'>" +
@@ -244,7 +244,7 @@ public class TestSshActionExecutor exten
action1.setName("ssh");
final SshActionExecutor ssh1 = new SshActionExecutor();
final Context context1 = new Context(workflow, action1);
- Thread.sleep(500);
+ sleep(500);
ssh1.start(context1, action1);
assertEquals(action1.getExternalId(), action.getExternalId());
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/TestXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/TestXCommand.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/TestXCommand.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/TestXCommand.java Wed Aug 22 01:14:45 2012
@@ -164,7 +164,7 @@ public class TestXCommand extends XTestC
public void testXCommandLifecycleLockingFailingToLock() throws Exception {
Thread t = new LockGetter();
t.start();
- Thread.sleep(150);
+ sleep(150);
AXCommand command = new AXCommand(true);
try {
command.call();
@@ -212,7 +212,7 @@ public class TestXCommand extends XTestC
if (lock == null) {
fail();
}
- Thread.sleep(150);
+ sleep(150);
}
catch (InterruptedException ex) {
// NOP
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleJobSuspendXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleJobSuspendXCommand.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleJobSuspendXCommand.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleJobSuspendXCommand.java Wed Aug 22 01:14:45 2012
@@ -130,7 +130,7 @@ public class TestBundleJobSuspendXComman
job = jpaService.execute(bundleJobGetCmd);
assertEquals(Job.Status.RUNNING, job.getStatus());
- Thread.sleep(2000);
+ sleep(2000);
BundleActionsGetJPAExecutor bundleActionsGetCmd = new BundleActionsGetJPAExecutor(job.getId());
List<BundleActionBean> actions = jpaService.execute(bundleActionsGetCmd);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleKillXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleKillXCommand.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleKillXCommand.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleKillXCommand.java Wed Aug 22 01:14:45 2012
@@ -111,7 +111,7 @@ public class TestBundleKillXCommand exte
job = jpaService.execute(bundleJobGetCmd);
assertEquals(Job.Status.RUNNING, job.getStatus());
- Thread.sleep(2000);
+ sleep(2000);
BundleActionsGetJPAExecutor bundleActionsGetCmd = new BundleActionsGetJPAExecutor(job.getId());
List<BundleActionBean> actions = jpaService.execute(bundleActionsGetCmd);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleStartXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleStartXCommand.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleStartXCommand.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/bundle/TestBundleStartXCommand.java Wed Aug 22 01:14:45 2012
@@ -73,7 +73,7 @@ public class TestBundleStartXCommand ext
job = jpaService.execute(bundleJobGetExecutor);
assertEquals(job.getStatus(), Job.Status.RUNNING);
- Thread.sleep(2000);
+ sleep(2000);
BundleActionsGetJPAExecutor bundleActionsGetExecutor = new BundleActionsGetJPAExecutor(job.getId());
List<BundleActionBean> actions = jpaService.execute(bundleActionsGetExecutor);
@@ -123,7 +123,7 @@ public class TestBundleStartXCommand ext
job = jpaService.execute(bundleJobGetExecutor);
assertEquals(job.getStatus(), Job.Status.RUNNING);
- Thread.sleep(2000);
+ sleep(2000);
final BundleActionsGetJPAExecutor bundleActionsGetExecutor = new BundleActionsGetJPAExecutor(job.getId());
List<BundleActionBean> actions = jpaService.execute(bundleActionsGetExecutor);
@@ -165,7 +165,7 @@ public class TestBundleStartXCommand ext
job = jpaService.execute(bundleJobGetExecutor);
assertEquals(job.getStatus(), Job.Status.RUNNING);
- Thread.sleep(2000);
+ sleep(2000);
BundleActionsGetJPAExecutor bundleActionsGetExecutor = new BundleActionsGetJPAExecutor(job.getId());
List<BundleActionBean> actions = jpaService.execute(bundleActionsGetExecutor);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestLastModified.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestLastModified.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestLastModified.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestLastModified.java Wed Aug 22 01:14:45 2012
@@ -123,7 +123,7 @@ public class TestLastModified extends XF
lastModTime = wf.getLastModifiedTime();
- Thread.sleep(1000);
+ sleep(1000);
wc.resume(jobId);
wf = wc.getJobInfo(jobId);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestReRunXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestReRunXCommand.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestReRunXCommand.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestReRunXCommand.java Wed Aug 22 01:14:45 2012
@@ -213,7 +213,7 @@ public class TestReRunXCommand extends X
writer = new FileWriter(getTestCaseDir() + "/workflow.xml");
IOUtils.copyCharStream(reader, writer);
- Thread.sleep(5000);
+ sleep(5000);
conf.setProperty(OozieClient.RERUN_SKIP_NODES, "hdfs11");
wfClient.reRun(jobId1, conf);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestWorkflowKillXCommand.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestWorkflowKillXCommand.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestWorkflowKillXCommand.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/command/wf/TestWorkflowKillXCommand.java Wed Aug 22 01:14:45 2012
@@ -142,13 +142,13 @@ public class TestWorkflowKillXCommand ex
services.destroy();
- Thread.sleep(5000);
+ sleep(5000);
setSystemProperty(LiteWorkflowStoreService.CONF_NODE_DEF_VERSION, LiteWorkflowStoreService.NODE_DEF_VERSION_1);
services = new Services();
services.init();
- Thread.sleep(5000);
+ sleep(5000);
new KillXCommand(job.getId()).call();
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestWorkflowActionsRunningGetJPAExecutor.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestWorkflowActionsRunningGetJPAExecutor.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestWorkflowActionsRunningGetJPAExecutor.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestWorkflowActionsRunningGetJPAExecutor.java Wed Aug 22 01:14:45 2012
@@ -49,7 +49,7 @@ public class TestWorkflowActionsRunningG
WorkflowJobBean job = addRecordToWfJobTable(WorkflowJob.Status.RUNNING, WorkflowInstance.Status.RUNNING);
addRecordToWfActionTable(job.getId(), "1", WorkflowAction.Status.OK);
addRecordToWfActionTableWithRunningStatus(job.getId(), "2", WorkflowAction.Status.RUNNING);
- Thread.sleep(2000);
+ sleep(2000);
_testGetRunningActions(1);
}
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestActionCheckerService.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestActionCheckerService.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestActionCheckerService.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestActionCheckerService.java Wed Aug 22 01:14:45 2012
@@ -101,7 +101,7 @@ public class TestActionCheckerService ex
return (engine.getJob(jobId).getStatus() == WorkflowJob.Status.RUNNING);
}
});
- Thread.sleep(2000);
+ sleep(2000);
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
@@ -117,7 +117,7 @@ public class TestActionCheckerService ex
assertNotNull(action);
assertEquals(WorkflowActionBean.Status.RUNNING, action.getStatus());
- Thread.sleep(2000);
+ sleep(2000);
Runnable actionCheckRunnable = new ActionCheckRunnable(0);
actionCheckRunnable.run();
@@ -159,7 +159,7 @@ public class TestActionCheckerService ex
conf.set("running-mode", "async");
final String jobId = engine.submitJob(conf, true);
- Thread.sleep(200);
+ sleep(200);
waitFor(5000, new Predicate() {
public boolean evaluate() throws Exception {
@@ -167,7 +167,7 @@ public class TestActionCheckerService ex
}
});
- Thread.sleep(100);
+ sleep(100);
JPAService jpaService = Services.get().get(JPAService.class);
assertNotNull(jpaService);
@@ -191,7 +191,7 @@ public class TestActionCheckerService ex
Runnable actionCheckRunnable = new ActionCheckRunnable(actionCheckDelay);
actionCheckRunnable.run();
- Thread.sleep(3000);
+ sleep(3000);
List<WorkflowActionBean> actions2 = jpaService.execute(actionsGetExecutor);
WorkflowActionBean action2 = null;
@@ -223,10 +223,10 @@ public class TestActionCheckerService ex
final CoordinatorActionBean action = addRecordToCoordActionTable(job.getId(), actionNum,
CoordinatorAction.Status.RUNNING, "coord-action-get.xml", wfJob.getId(), "RUNNING", 0);
- Thread.sleep(3000);
+ sleep(3000);
Runnable actionCheckRunnable = new ActionCheckRunnable(1);
actionCheckRunnable.run();
- Thread.sleep(3000);
+ sleep(3000);
waitFor(200000, new Predicate() {
public boolean evaluate() throws Exception {
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestCoordMaterializeTriggerService.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestCoordMaterializeTriggerService.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestCoordMaterializeTriggerService.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestCoordMaterializeTriggerService.java Wed Aug 22 01:14:45 2012
@@ -67,10 +67,10 @@ public class TestCoordMaterializeTrigger
Date end = DateUtils.parseDateOozieTZ("2009-02-20T23:59Z");
final CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.PREP, start, end, false, false, 0);
- Thread.sleep(3000);
+ sleep(3000);
Runnable runnable = new CoordMaterializeTriggerRunnable(3600, 300);
runnable.run();
- Thread.sleep(1000);
+ sleep(1000);
JPAService jpaService = Services.get().get(JPAService.class);
CoordJobGetJPAExecutor coordGetCmd = new CoordJobGetJPAExecutor(job.getId());
@@ -91,10 +91,10 @@ public class TestCoordMaterializeTrigger
Date end = new Date(start.getTime() + 3600 * 48 * 1000);
final CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.PREP, start, end, false, false, 0);
- Thread.sleep(3000);
+ sleep(3000);
Runnable runnable = new CoordMaterializeTriggerRunnable(3600, 300);
runnable.run();
- Thread.sleep(1000);
+ sleep(1000);
JPAService jpaService = Services.get().get(JPAService.class);
CoordJobGetJPAExecutor coordGetCmd = new CoordJobGetJPAExecutor(job.getId());
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestPurgeService.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestPurgeService.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestPurgeService.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestPurgeService.java Wed Aug 22 01:14:45 2012
@@ -110,7 +110,7 @@ public class TestPurgeService extends XD
});
assertEquals(WorkflowJob.Status.SUCCEEDED, engine.getJob(jobId).getStatus());
new PurgeXCommand(1, 10000).call();
- Thread.sleep(1000);
+ sleep(1000);
JPAService jpaService = Services.get().get(JPAService.class);
WorkflowJobGetJPAExecutor wfJobGetCmd = new WorkflowJobGetJPAExecutor(jobId);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestRecoveryService.java Wed Aug 22 01:14:45 2012
@@ -117,12 +117,12 @@ public class TestRecoveryService extends
conf.set("running-mode", "async");
//TODO CHECK, without this we get JPA concurrency exceptions, ODD
- Thread.sleep(1000);
+ sleep(1000);
final String jobId = engine.submitJob(conf, true);
//TODO CHECK, without this we get JPA concurrency exceptions, ODD
- Thread.sleep(1000);
+ sleep(1000);
waitFor(5000, new Predicate() {
public boolean evaluate() throws Exception {
@@ -130,7 +130,7 @@ public class TestRecoveryService extends
}
});
- Thread.sleep(1000);
+ sleep(1000);
final WorkflowStore store = Services.get().get(WorkflowStoreService.class).create();
store.beginTrx();
List<WorkflowActionBean> actions = store.getActionsForWorkflow(jobId, false);
@@ -154,7 +154,7 @@ public class TestRecoveryService extends
Runnable recoveryRunnable = new RecoveryRunnable(0, 60, 60);
recoveryRunnable.run();
- Thread.sleep(3000);
+ sleep(3000);
final WorkflowStore store2 = Services.get().get(WorkflowStoreService.class).create();
assertEquals(WorkflowJob.Status.RUNNING, engine.getJob(jobId).getStatus());
@@ -167,9 +167,9 @@ public class TestRecoveryService extends
store2.commitTrx();
store2.closeTrx();
- Thread.sleep(1000);
+ sleep(1000);
recoveryRunnable.run();
- Thread.sleep(3000);
+ sleep(3000);
waitFor(10000, new Predicate() {
public boolean evaluate() throws Exception {
@@ -200,7 +200,7 @@ public class TestRecoveryService extends
Runnable recoveryRunnable = new RecoveryRunnable(0, 60, 60);
recoveryRunnable.run();
- Thread.sleep(3000);
+ sleep(3000);
final WorkflowActionGetJPAExecutor wfActionGetCmd = new WorkflowActionGetJPAExecutor(action.getId());
@@ -261,7 +261,7 @@ public class TestRecoveryService extends
store.closeTrx();
}
- Thread.sleep(3000);
+ sleep(3000);
Runnable recoveryRunnable = new RecoveryRunnable(0, 1,1);
recoveryRunnable.run();
@@ -307,7 +307,7 @@ public class TestRecoveryService extends
createDir(getTestCaseDir() + "/2009/15/");
createDir(getTestCaseDir() + "/2009/08/");
- Thread.sleep(3000);
+ sleep(3000);
Runnable recoveryRunnable = new RecoveryRunnable(0, 1, 1);
recoveryRunnable.run();
@@ -347,7 +347,7 @@ public class TestRecoveryService extends
addRecordToCoordActionTable(coordJob.getId(), 1,
CoordinatorAction.Status.SUSPENDED, "coord-action-get.xml", wfJobId, "RUNNING", 1);
- Thread.sleep(3000);
+ sleep(3000);
Runnable recoveryRunnable = new RecoveryRunnable(0, 1, 1);
recoveryRunnable.run();
@@ -384,7 +384,7 @@ public class TestRecoveryService extends
addRecordToCoordActionTable(coordJob.getId(), 1,
CoordinatorAction.Status.KILLED, "coord-action-get.xml", wfJobId, "RUNNING", 1);
- Thread.sleep(3000);
+ sleep(3000);
Runnable recoveryRunnable = new RecoveryRunnable(0, 1, 1);
recoveryRunnable.run();
@@ -421,7 +421,7 @@ public class TestRecoveryService extends
addRecordToCoordActionTable(coordJob.getId(), 1,
CoordinatorAction.Status.RUNNING, "coord-action-get.xml", wfJobId, "SUSPENDED", 1);
- Thread.sleep(3000);
+ sleep(3000);
Runnable recoveryRunnable = new RecoveryRunnable(0, 1, 1);
recoveryRunnable.run();
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestStatusTransitService.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestStatusTransitService.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestStatusTransitService.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestStatusTransitService.java Wed Aug 22 01:14:45 2012
@@ -89,7 +89,7 @@ public class TestStatusTransitService ex
Runnable runnable = new StatusTransitRunnable();
runnable.run();
- Thread.sleep(1000);
+ sleep(1000);
JPAService jpaService = Services.get().get(JPAService.class);
CoordJobGetJPAExecutor coordGetCmd = new CoordJobGetJPAExecutor(job.getId());
@@ -115,7 +115,7 @@ public class TestStatusTransitService ex
Runnable runnable = new StatusTransitRunnable();
runnable.run();
- Thread.sleep(1000);
+ sleep(1000);
JPAService jpaService = Services.get().get(JPAService.class);
CoordJobGetJPAExecutor coordGetCmd = new CoordJobGetJPAExecutor(job.getId());
@@ -152,7 +152,7 @@ public class TestStatusTransitService ex
Runnable runnable = new StatusTransitRunnable();
runnable.run();
- Thread.sleep(1000);
+ sleep(1000);
CoordJobGetJPAExecutor coordGetCmd = new CoordJobGetJPAExecutor(coordJob.getId());
coordJob = jpaService.execute(coordGetCmd);
@@ -385,7 +385,7 @@ public class TestStatusTransitService ex
assertEquals(Job.Status.SUSPENDED, coordJob.getStatus());
- Thread.sleep(3000);
+ sleep(3000);
new CoordResumeXCommand(coordJobId).call();
@@ -635,7 +635,7 @@ public class TestStatusTransitService ex
Runnable runnable = new StatusTransitRunnable();
runnable.run();
- Thread.sleep(1000);
+ sleep(1000);
JPAService jpaService = Services.get().get(JPAService.class);
CoordJobGetJPAExecutor coordGetCmd = new CoordJobGetJPAExecutor(job.getId());
@@ -760,14 +760,14 @@ public class TestStatusTransitService ex
assertEquals(Job.Status.SUSPENDED, job.getStatus());
- Thread.sleep(3000);
+ sleep(3000);
new BundleJobResumeXCommand(bundleId).call();
job = jpaService.execute(bundleJobGetCmd);
assertTrue(job.getStatus() == Job.Status.SUCCEEDED || job.getStatus() == Job.Status.RUNNING);
- Thread.sleep(3000);
+ sleep(3000);
Runnable runnable = new StatusTransitRunnable();
runnable.run();
@@ -1175,7 +1175,7 @@ public class TestStatusTransitService ex
runnable = new StatusTransitRunnable();
runnable.run();
- Thread.sleep(1000);
+ sleep(1000);
JPAService jpaService = Services.get().get(JPAService.class);
CoordJobGetJPAExecutor coordGetCmd = new CoordJobGetJPAExecutor(job.getId());
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestXLogService.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestXLogService.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestXLogService.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestXLogService.java Wed Aug 22 01:14:45 2012
@@ -97,7 +97,7 @@ public class TestXLogService extends XTe
XLogService ls = new XLogService();
ls.init(null);
assertTrue(LogFactory.getLog("a").isTraceEnabled());
- Thread.sleep(1 * 1000);
+ sleep(1 * 1000);
is = cl.getResourceAsStream("test-custom-log4j.properties");
IOUtils.copyStream(is, new FileOutputStream(log4jFile));
float originalRatio = XTestCase.WAITFOR_RATIO;
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/store/TestDBWorkflowStore.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/store/TestDBWorkflowStore.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/store/TestDBWorkflowStore.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/store/TestDBWorkflowStore.java Wed Aug 22 01:14:45 2012
@@ -188,7 +188,7 @@ public class TestDBWorkflowStore extends
// assertEquals(1,
// store.getWorkflowCountWithStatusInLastNSeconds(WorkflowJob.Status.SUCCEEDED.name(),
// 5));
- Thread.sleep(1000);
+ sleep(1000);
long t1 = System.currentTimeMillis();
WorkflowJobBean wfBean = store.getWorkflow(wfBean2.getId(), false);
store.updateWorkflow(wfBean);
Modified: incubator/oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java (original)
+++ incubator/oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java Wed Aug 22 01:14:45 2012
@@ -537,6 +537,20 @@ public abstract class XTestCase extends
throw new RuntimeException(ex);
}
}
+
+ /**
+ * Wait the specified amount of time; the timeout will be scaled by the oozie.test.waitfor.ratio property.
+ *
+ * @param sleepTime time in milliseconds to wait
+ */
+ protected void sleep(int sleepTime) {
+ waitFor(sleepTime, new Predicate() {
+ @Override
+ public boolean evaluate() throws Exception {
+ return false;
+ }
+ });
+ }
/**
* Return the Hadoop Job Tracker to use for testing. </p> The value is taken from the Java sytem property {@link
Modified: incubator/oozie/trunk/release-log.txt
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/release-log.txt?rev=1375868&r1=1375867&r2=1375868&view=diff
==============================================================================
--- incubator/oozie/trunk/release-log.txt (original)
+++ incubator/oozie/trunk/release-log.txt Wed Aug 22 01:14:45 2012
@@ -1,5 +1,6 @@
-- Oozie 3.3.0 release (trunk - unreleased)
+OOZIE-957 TestStatusTransitService and TestCoordKillXCommand are failing randomly; replace Thread.sleep() (rkanter via tucu)
OOZIE-477 Adding configurable filesystem support instead of hardcoded "hdfs" (mayank, mona via tucu)
OOZIE-906 Show runtime job DAG visually in Oozie console/dashboard (vaidya via virag)
OOZIE-958 typo in error message of E0736 (egashira via virag)