This is an automated email from the ASF dual-hosted git repository.

pnowojski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 812a3f38ca694dc57da1d7e902eabe6d1d5b68b5
Author: Aleksey Pak <alek...@ververica.com>
AuthorDate: Wed Jun 26 13:16:37 2019 +0200

    [hotfix][tests] StreamTaskTestHarness: use Preconditions.checkState instead 
of explicit throw IllegalStateException
---
 .../flink/streaming/runtime/tasks/StreamTaskTestHarness.java      | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git 
a/flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskTestHarness.java
 
b/flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskTestHarness.java
index c1f53c5..12fa8be 100644
--- 
a/flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskTestHarness.java
+++ 
b/flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskTestHarness.java
@@ -264,9 +264,7 @@ public class StreamTaskTestHarness<OUT> {
         * @throws Exception
         */
        public void waitForTaskCompletion(long timeout) throws Exception {
-               if (taskThread == null) {
-                       throw new IllegalStateException("Task thread was not 
started.");
-               }
+               Preconditions.checkState(taskThread != null, "Task thread was 
not started.");
 
                taskThread.join(timeout);
                if (taskThread.getError() != null) {
@@ -291,9 +289,7 @@ public class StreamTaskTestHarness<OUT> {
         * @throws Exception
         */
        public void waitForTaskRunning(long timeout) throws Exception {
-               if (taskThread == null || taskThread.task == null) {
-                       throw new IllegalStateException("Task thread was not 
started.");
-               }
+               Preconditions.checkState(taskThread != null, "Task thread was 
not started.");
                StreamTask<?, ?> streamTask = taskThread.task;
                while (!streamTask.isRunning()) {
                        Thread.sleep(10);

Reply via email to