This is an automated email from the ASF dual-hosted git repository. brandonwilliams pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push: new 95224b7 Wait for async abort to finish in StreamTransferTaskTest 95224b7 is described below commit 95224b71e19e2b7f18596da070937291f040f695 Author: Brandon Williams <brandonwilli...@apache.org> AuthorDate: Wed Feb 12 17:47:53 2020 -0600 Wait for async abort to finish in StreamTransferTaskTest Patch by brandonwilliams, reviewed by Dinesh Joshi for CASSANDRA-15550 --- .../apache/cassandra/streaming/StreamTransferTaskTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/unit/org/apache/cassandra/streaming/StreamTransferTaskTest.java b/test/unit/org/apache/cassandra/streaming/StreamTransferTaskTest.java index 80607c5..2361125 100644 --- a/test/unit/org/apache/cassandra/streaming/StreamTransferTaskTest.java +++ b/test/unit/org/apache/cassandra/streaming/StreamTransferTaskTest.java @@ -34,6 +34,7 @@ import org.junit.Test; import io.netty.channel.embedded.EmbeddedChannel; import org.junit.Assert; import org.apache.cassandra.SchemaLoader; +import org.apache.cassandra.concurrent.ScheduledExecutors; import org.apache.cassandra.db.ColumnFamilyStore; import org.apache.cassandra.db.Keyspace; import org.apache.cassandra.db.streaming.CassandraOutgoingFile; @@ -169,6 +170,16 @@ public class StreamTransferTaskTest assertEquals(1, ref.globalCount()); } + //wait for stream to abort asynchronously + int tries = 10; + while (ScheduledExecutors.nonPeriodicTasks.getActiveCount() > 0) + { + if(tries < 1) + throw new RuntimeException("test did not complete in time"); + Thread.sleep(10); + tries--; + } + //simulate finish transfer for (OutgoingStreamMessage file : files) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org