You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2016/05/13 07:53:52 UTC
ignite git commit: ignite-1.6 Fixed tests.
Repository: ignite
Updated Branches:
refs/heads/ignite-1.6 2ac4aa603 -> 0534f7a38
ignite-1.6 Fixed tests.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/0534f7a3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/0534f7a3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/0534f7a3
Branch: refs/heads/ignite-1.6
Commit: 0534f7a38c4dc4829fc58ea1cedf00eb3bed89a3
Parents: 2ac4aa6
Author: sboikov <sb...@gridgain.com>
Authored: Fri May 13 10:53:44 2016 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri May 13 10:53:44 2016 +0300
----------------------------------------------------------------------
.../GridEventStorageCheckAllEventsSelfTest.java | 28 +++++++++++++++++++-
.../internal/GridTaskExecutionSelfTest.java | 14 +++++-----
.../ignite/testsuites/IgniteBasicTestSuite.java | 2 +-
3 files changed, 36 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/0534f7a3/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageCheckAllEventsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageCheckAllEventsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageCheckAllEventsSelfTest.java
index c3f77c7..0619391 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageCheckAllEventsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageCheckAllEventsSelfTest.java
@@ -30,10 +30,12 @@ import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.ComputeJobAdapter;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskFuture;
+import org.apache.ignite.compute.ComputeTaskMapAsync;
import org.apache.ignite.compute.ComputeTaskSession;
import org.apache.ignite.compute.ComputeTaskSessionFullSupport;
import org.apache.ignite.compute.ComputeTaskSplitAdapter;
import org.apache.ignite.compute.ComputeTaskTimeoutException;
+import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.events.CheckpointEvent;
import org.apache.ignite.events.DeploymentEvent;
import org.apache.ignite.events.Event;
@@ -86,6 +88,16 @@ public class GridEventStorageCheckAllEventsSelfTest extends GridCommonAbstractTe
}
/** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration() throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration();
+
+ // TODO: IGNITE-3099 (hotfix the test to check the event order in common case).
+ cfg.setPublicThreadPoolSize(1);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
ignite = G.ignite(getTestGridName());
@@ -140,10 +152,23 @@ public class GridEventStorageCheckAllEventsSelfTest extends GridCommonAbstractTe
* @throws Exception If test failed.
*/
public void testTaskUndeployEvents() throws Exception {
- long tstamp = startTimestamp();
+ final long tstamp = startTimestamp();
generateEvents(null, new GridAllEventsSuccessTestJob()).get();
+ // TODO: IGNITE-3099 (hotfix the test to check the event order in common case).
+ GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ try {
+ List<Event> evts = pullEvents(tstamp, 10);
+ return evts.get(evts.size() - 1).type() == EVT_JOB_FINISHED;
+ }
+ catch (Exception e) {
+ return false;
+ }
+ }
+ }, 500);
+
ignite.compute().undeployTask(GridAllEventsTestTask.class.getName());
ignite.compute().localDeployTask(GridAllEventsTestTask.class, GridAllEventsTestTask.class.getClassLoader());
@@ -463,6 +488,7 @@ public class GridEventStorageCheckAllEventsSelfTest extends GridCommonAbstractTe
*
*/
@ComputeTaskSessionFullSupport
+ @ComputeTaskMapAsync // TODO: IGNITE-3099 (hotfix the test to check the event order in common case).
private static class GridAllEventsTestTask extends ComputeTaskSplitAdapter<Object, Object> {
/** {@inheritDoc} */
@Override protected Collection<? extends ComputeJob> split(int gridSize, Object arg) {
http://git-wip-us.apache.org/repos/asf/ignite/blob/0534f7a3/modules/core/src/test/java/org/apache/ignite/internal/GridTaskExecutionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskExecutionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskExecutionSelfTest.java
index 142b9db..996acd6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskExecutionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskExecutionSelfTest.java
@@ -47,19 +47,21 @@ public class GridTaskExecutionSelfTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override protected void beforeTestsStarted() throws Exception {
- ignite = startGrid(1);
-
+ startGrid(1);
startGrid(2);
startGrid(3);
}
/** {@inheritDoc} */
@Override protected void afterTestsStopped() throws Exception {
- stopGrid(1);
- stopGrid(2);
- stopGrid(3);
+ stopAllGrids();
+ }
- ignite = null;
+ /**
+ * {@inheritDoc}
+ */
+ @Override protected void beforeTest() throws Exception {
+ ignite = grid(1);
}
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/0534f7a3/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
index fd6a44a..6611500 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
@@ -77,9 +77,9 @@ public class IgniteBasicTestSuite extends TestSuite {
public static TestSuite suite(Set<Class> ignoredTests) throws Exception {
TestSuite suite = new TestSuite("Ignite Basic Test Suite");
+ suite.addTest(IgniteMarshallerSelfTestSuite.suite(ignoredTests));
suite.addTest(IgniteLangSelfTestSuite.suite());
suite.addTest(IgniteUtilSelfTestSuite.suite(ignoredTests));
- suite.addTest(IgniteMarshallerSelfTestSuite.suite(ignoredTests));
suite.addTest(IgniteKernalSelfTestSuite.suite(ignoredTests));
suite.addTest(IgniteStartUpTestSuite.suite());