Return-Path: X-Original-To: apmail-falcon-commits-archive@minotaur.apache.org Delivered-To: apmail-falcon-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 71AFD17CFA for ; Wed, 3 Jun 2015 12:45:34 +0000 (UTC) Received: (qmail 88992 invoked by uid 500); 3 Jun 2015 12:45:34 -0000 Delivered-To: apmail-falcon-commits-archive@falcon.apache.org Received: (qmail 88956 invoked by uid 500); 3 Jun 2015 12:45:34 -0000 Mailing-List: contact commits-help@falcon.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@falcon.apache.org Delivered-To: mailing list commits@falcon.apache.org Received: (qmail 88947 invoked by uid 99); 3 Jun 2015 12:45:34 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jun 2015 12:45:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CAE49E098A; Wed, 3 Jun 2015 12:45:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rostafiychuk@apache.org To: commits@falcon.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: falcon git commit: FALCON-1253 Fortify ExternalFSTest. Contributed by Ruslan Ostafiychuk Date: Wed, 3 Jun 2015 12:45:33 +0000 (UTC) Repository: falcon Updated Branches: refs/heads/master 2ebf12837 -> c6c92134e FALCON-1253 Fortify ExternalFSTest. Contributed by Ruslan Ostafiychuk Project: http://git-wip-us.apache.org/repos/asf/falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/c6c92134 Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/c6c92134 Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/c6c92134 Branch: refs/heads/master Commit: c6c92134efb727918da69c9cd31206dff29cddad Parents: 2ebf128 Author: Ruslan Ostafiychuk Authored: Wed Jun 3 14:43:12 2015 +0300 Committer: Ruslan Ostafiychuk Committed: Wed Jun 3 15:44:00 2015 +0300 ---------------------------------------------------------------------- falcon-regression/CHANGES.txt | 2 + .../regression/core/util/InstanceUtil.java | 42 +++++++++++--------- 2 files changed, 26 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/falcon/blob/c6c92134/falcon-regression/CHANGES.txt ---------------------------------------------------------------------- diff --git a/falcon-regression/CHANGES.txt b/falcon-regression/CHANGES.txt index ecff1c6..e55800a 100644 --- a/falcon-regression/CHANGES.txt +++ b/falcon-regression/CHANGES.txt @@ -87,6 +87,8 @@ Trunk (Unreleased) via Samarth Gupta) IMPROVEMENTS + FALCON-1253 Fortify ExternalFSTest (Ruslan Ostafiychuk) + FALCON-1243 Feed test update as per new UI changes (Namit Maheshwari) FALCON-1241 Fix SearchApiTest according to changes in API, tag ClusterSetupTest, http://git-wip-us.apache.org/repos/asf/falcon/blob/c6c92134/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java ---------------------------------------------------------------------- diff --git a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java index 1ce1a13..9aa3a0b 100644 --- a/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java +++ b/falcon-regression/merlin-core/src/main/java/org/apache/falcon/regression/core/util/InstanceUtil.java @@ -538,28 +538,34 @@ public final class InstanceUtil { Assert.fail("Could not retrieve bundles"); } List bundleIds = OozieUtil.getBundleIds(bundleJobs); - String bundleId = OozieUtil.getMaxId(bundleIds); - LOGGER.info(String.format("Using bundle %s", bundleId)); - final String coordId; - final Status bundleStatus = client.getBundleJobInfo(bundleId).getStatus(); - Assert.assertTrue(RUNNING_PREP_SUCCEEDED.contains(bundleStatus), - String.format("Bundle job %s is should be prep/running but is %s", bundleId, bundleStatus)); - OozieUtil.waitForCoordinatorJobCreation(client, bundleId); - List coords = client.getBundleJobInfo(bundleId).getCoordinators(); - List cIds = new ArrayList<>(); - if (entityType == EntityType.PROCESS) { - for (CoordinatorJob coord : coords) { - cIds.add(coord.getId()); - } - coordId = OozieUtil.getMinId(cIds); - } else { - for (CoordinatorJob coord : coords) { - if (coord.getAppName().contains("FEED_REPLICATION")) { + Collections.sort(bundleIds, Collections.reverseOrder()); + String coordId = null; + for (String bundleId : bundleIds) { + LOGGER.info(String.format("Using bundle %s", bundleId)); + final Status status = client.getBundleJobInfo(bundleId).getStatus(); + Assert.assertTrue(RUNNING_PREP_SUCCEEDED.contains(status), + String.format("Bundle job %s is should be prep/running but is %s", bundleId, status)); + OozieUtil.waitForCoordinatorJobCreation(client, bundleId); + List coords = client.getBundleJobInfo(bundleId).getCoordinators(); + List cIds = new ArrayList<>(); + if (entityType == EntityType.PROCESS) { + for (CoordinatorJob coord : coords) { cIds.add(coord.getId()); } + coordId = OozieUtil.getMinId(cIds); + } else { + for (CoordinatorJob coord : coords) { + if (coord.getAppName().contains("FEED_REPLICATION")) { + cIds.add(coord.getId()); + } + } + if (!cIds.isEmpty()) { + coordId = cIds.get(0); + break; + } } - coordId = cIds.get(0); } + Assert.assertNotNull(coordId, "Coordinator id not found"); LOGGER.info(String.format("Using coordinator id: %s", coordId)); int maxTries = 50; int totalSleepTime = totalMinutesToWait * 60;