diff --git a/cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java b/cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java index 7dd9c353..c53ea0e3 100644 --- a/cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java +++ b/cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java @@ -400,8 +400,8 @@ public int getCountForClaimedProcInstPerKey(String procDefKey, List clai public List> getProcDefKeyLatestCompleteInst(String procDefKey) { return jdbcTemplate.queryForList( - "SELECT proc_inst_id, start_time, end_time FROM cws_proc_inst_status WHERE proc_def_key=? AND status='complete' ORDER BY start_time DESC LIMIT 1", - new Object[]{procDefKey} + "SELECT proc_inst_id, start_time, end_time FROM cws_proc_inst_status WHERE proc_def_key=? AND status='complete' ORDER BY start_time DESC LIMIT 1", + new Object[]{procDefKey} ); } @@ -604,8 +604,8 @@ public int getNumUpWorkers() { */ public List> getWorkerNumRunningProcs() { return jdbcTemplate.queryForList( - "SELECT cws_worker.id, active_count as cnt " + - "FROM cws_worker"); + "SELECT cws_worker.id, COUNT(*) AS cnt FROM cws_proc_inst_status,cws_worker " + + "WHERE cws_proc_inst_status.status NOT LIKE '%complete%' GROUP BY cws_worker.id"); } diff --git a/cws-test/src/test/java/jpl/cws/test/integration/ui/SystemLevelTestIT.java b/cws-test/src/test/java/jpl/cws/test/integration/ui/SystemLevelTestIT.java index fb94b15b..d48895aa 100644 --- a/cws-test/src/test/java/jpl/cws/test/integration/ui/SystemLevelTestIT.java +++ b/cws-test/src/test/java/jpl/cws/test/integration/ui/SystemLevelTestIT.java @@ -63,7 +63,7 @@ public void runWorkerTest() throws IOException { log.info("Checking if 1 worker is up, 0 are down, and none are running..."); if (findOnPage("1 Workers (1 up, 0 down)") - && findOnPage("0 running")) { + && findOnPage("Idle")) { log.info("SUCCESS: 1 worker is up, 0 are down, and none are running."); WebElement myTable = driver.findElement(By.id("workers-table")); List myRows = myTable.findElements(By.tagName("td")); diff --git a/cws-test/src/test/java/jpl/cws/test/integration/ui/WorkersTestIT.java b/cws-test/src/test/java/jpl/cws/test/integration/ui/WorkersTestIT.java index 09b64d32..b429a6c3 100644 --- a/cws-test/src/test/java/jpl/cws/test/integration/ui/WorkersTestIT.java +++ b/cws-test/src/test/java/jpl/cws/test/integration/ui/WorkersTestIT.java @@ -35,7 +35,7 @@ public void runWorkersPageTest() { gotoLoginPage(); login(); goToPage("deployments"); - startProcDef("test_workers_page", "Test Workers Page", 30000); + startProcDef("test_workers_page", "Test Workers Page", 0); runNumberActiveTest(); runThreadLimitTest(); runWorkersCheckBoxTest(); diff --git a/cws-test/src/test/resources/bpmn/test_workers_page.bpmn b/cws-test/src/test/resources/bpmn/test_workers_page.bpmn index 08c4a375..96000f45 100644 --- a/cws-test/src/test/resources/bpmn/test_workers_page.bpmn +++ b/cws-test/src/test/resources/bpmn/test_workers_page.bpmn @@ -23,9 +23,11 @@ - sleep 30 + sleep 192 + + + . - 0 @@ -99,6 +101,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -113,35 +140,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - -