asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amo...@apache.org
Subject asterixdb git commit: Fix testScanUnion() to wait in close() until every input calls writer.open().
Date Fri, 14 Apr 2017 23:35:03 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 78b9f7f01 -> 0e7bb922f


Fix testScanUnion() to wait in close() until every input
calls writer.open().

Change-Id: I8d4ead7a2a70c4287509f5f25f90534f56960035
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1683
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
BAD: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: abdullah alamoudi <bamousaa@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/0e7bb922
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/0e7bb922
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/0e7bb922

Branch: refs/heads/master
Commit: 0e7bb922f064948dee8578b2391f05c09d3c872f
Parents: 78b9f7f
Author: Yingyi Bu <yingyi@couchbase.com>
Authored: Fri Apr 14 14:36:20 2017 -0700
Committer: abdullah alamoudi <bamousaa@gmail.com>
Committed: Fri Apr 14 16:34:31 2017 -0700

----------------------------------------------------------------------
 .../tests/rewriting/SuperActivityRewritingTest.java      | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/0e7bb922/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/rewriting/SuperActivityRewritingTest.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/rewriting/SuperActivityRewritingTest.java
b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/rewriting/SuperActivityRewritingTest.java
index 683857f..8b0b8a0 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/rewriting/SuperActivityRewritingTest.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/rewriting/SuperActivityRewritingTest.java
@@ -21,6 +21,7 @@ package org.apache.hyracks.tests.rewriting;
 import java.nio.ByteBuffer;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.concurrent.CountDownLatch;
 
 import org.apache.hyracks.api.comm.IFrameWriter;
 import org.apache.hyracks.api.constraints.PartitionConstraintHelper;
@@ -124,7 +125,8 @@ class ThreadCountingOperatorDescriptor extends AbstractOperatorDescriptor
{
                 IRecordDescriptorProvider recordDescProvider, int partition, int nPartitions)
                         throws HyracksDataException {
             return new IOperatorNodePushable() {
-                private Set<Long> threads = new HashSet<Long>();
+                private CountDownLatch allOpenedSignal = new CountDownLatch(3);
+                private Set<Long> threads = new HashSet<>();
 
                 @Override
                 public void initialize() throws HyracksDataException {
@@ -154,6 +156,7 @@ class ThreadCountingOperatorDescriptor extends AbstractOperatorDescriptor
{
                     return new IFrameWriter() {
                         @Override
                         public void open() throws HyracksDataException {
+                            allOpenedSignal.countDown();
                             synchronized (threads) {
                                 threads.add(Thread.currentThread().getId());
                             }
@@ -171,7 +174,11 @@ class ThreadCountingOperatorDescriptor extends AbstractOperatorDescriptor
{
 
                         @Override
                         public void close() throws HyracksDataException {
-
+                            try {
+                                allOpenedSignal.await();
+                            } catch (InterruptedException e) {
+                                // This test should not be interrupted
+                            }
                         }
 
                         @Override


Mime
View raw message