Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-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 D49261769F for ; Mon, 27 Apr 2015 15:39:56 +0000 (UTC) Received: (qmail 96295 invoked by uid 500); 27 Apr 2015 15:39:56 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 96266 invoked by uid 500); 27 Apr 2015 15:39:56 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 96257 invoked by uid 99); 27 Apr 2015 15:39:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2015 15:39:56 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [54.191.145.13] (HELO mx1-us-west.apache.org) (54.191.145.13) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2015 15:39:51 +0000 Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id BFF81273E7 for ; Mon, 27 Apr 2015 15:39:27 +0000 (UTC) Received: (qmail 94483 invoked by uid 99); 27 Apr 2015 15:39:27 -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; Mon, 27 Apr 2015 15:39:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7AEADE179C; Mon, 27 Apr 2015 15:39:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Mon, 27 Apr 2015 15:39:40 -0000 Message-Id: <295abdf070594b33afee8b147ba36ecd@git.apache.org> In-Reply-To: <8c3e68ab378b4a5fac821f459347aec2@git.apache.org> References: <8c3e68ab378b4a5fac821f459347aec2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [14/15] incubator-ignite git commit: # ignite-sprint-4 avoid infinite loop in test X-Virus-Checked: Checked by ClamAV on apache.org # ignite-sprint-4 avoid infinite loop in test Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5fb79489 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5fb79489 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5fb79489 Branch: refs/heads/ignite-779 Commit: 5fb79489f7f9df895ce9044e3e87e30445be19f6 Parents: 7d69c39 Author: sboikov Authored: Mon Apr 27 16:40:50 2015 +0300 Committer: sboikov Committed: Mon Apr 27 16:49:45 2015 +0300 ---------------------------------------------------------------------- .../DataStreamerMultiThreadedSelfTest.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5fb79489/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerMultiThreadedSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerMultiThreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerMultiThreadedSelfTest.java index 5eedd8d..2382a66 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerMultiThreadedSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerMultiThreadedSelfTest.java @@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.datastreamer; import org.apache.ignite.*; import org.apache.ignite.configuration.*; import org.apache.ignite.internal.*; +import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; import org.apache.ignite.spi.discovery.tcp.*; import org.apache.ignite.spi.discovery.tcp.ipfinder.*; @@ -68,33 +69,41 @@ public class DataStreamerMultiThreadedSelfTest extends GridCommonAbstractTest { */ public void testStartStopIgnites() throws Exception { for (int attempt = 0; attempt < 3; ++attempt) { + log.info("Iteration: " + attempt); + final Ignite ignite = startGrid(0); Set futs = new HashSet<>(); + IgniteInternalFuture fut; + try (final DataStreamerImpl dataLdr = (DataStreamerImpl)ignite.dataStreamer(null)) { dataLdr.maxRemapCount(0); final AtomicInteger igniteId = new AtomicInteger(1); - IgniteInternalFuture fut = GridTestUtils.runMultiThreadedAsync(new Callable() { + fut = GridTestUtils.runMultiThreadedAsync(new Callable() { @Override public Object call() throws Exception { for (int i = 1; i < 5; ++i) startGrid(igniteId.incrementAndGet()); return true; } - }, 2, "startedGridThread"); + }, 2, "start-node-thread"); + + Random random = new Random(); - Random random = new Random(); + long endTime = U.currentTimeMillis() + 15_000; - while (!fut.isDone()) - futs.add(dataLdr.addData(random.nextInt(100000), random.nextInt(100000))); + while (!fut.isDone() && U.currentTimeMillis() < endTime) + futs.add(dataLdr.addData(random.nextInt(100_000), random.nextInt(100_000))); } for (IgniteFuture f : futs) f.get(); + fut.get(); + stopAllGrids(); } }