ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [1/2] incubator-ignite git commit: # Minor fix to a flaky Hadoop test.
Date Mon, 23 Mar 2015 07:40:51 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 5d2860bb1 -> b15d44fd3


# Minor fix to a flaky Hadoop 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/2b98d686
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2b98d686
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2b98d686

Branch: refs/heads/ignite-45
Commit: 2b98d686390df946cb231af30286c09ed7474d69
Parents: 7a7cc17
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Mon Mar 23 10:40:37 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Mar 23 10:40:37 2015 +0300

----------------------------------------------------------------------
 .../processors/hadoop/HadoopMapReduceTest.java  | 24 +++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2b98d686/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
index 6242ecc..8a3a0ac 100644
--- a/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
+++ b/modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopMapReduceTest.java
@@ -184,14 +184,32 @@ public class HadoopMapReduceTest extends HadoopAbstractWordCountTest
{
 
         final IgfsPath statPath = new IgfsPath("/xxx/yyy/zzz/" + jobId + "/performance");
 
-        GridTestUtils.waitForCondition(new GridAbsPredicate() {
+        assert GridTestUtils.waitForCondition(new GridAbsPredicate() {
             @Override public boolean apply() {
                 return igfs.exists(statPath);
             }
         }, 10000);
 
-        BufferedReader reader = new BufferedReader(new InputStreamReader(igfs.open(statPath)));
+        final long apiEvtCnt0 = apiEvtCnt;
 
-        assertEquals(apiEvtCnt, HadoopTestUtils.simpleCheckJobStatFile(reader));
+        boolean res = GridTestUtils.waitForCondition(new GridAbsPredicate() {
+            @Override public boolean apply() {
+                try {
+                    try (BufferedReader reader = new BufferedReader(new InputStreamReader(igfs.open(statPath))))
{
+                        return apiEvtCnt0 == HadoopTestUtils.simpleCheckJobStatFile(reader);
+                    }
+                }
+                catch (IOException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        }, 10000);
+
+        if (!res) {
+            BufferedReader reader = new BufferedReader(new InputStreamReader(igfs.open(statPath)));
+
+            assert false : "Invalid API events count [exp=" + apiEvtCnt0 +
+                ", actual=" + HadoopTestUtils.simpleCheckJobStatFile(reader) + ']';
+        }
     }
 }


Mime
View raw message