|
25 | 25 | import static org.junit.Assert.assertTrue;
|
26 | 26 | import static org.junit.Assert.fail;
|
27 | 27 |
|
28 |
| -import com.googlecode.junittoolbox.ParallelParameterized; |
29 | 28 | import com.uber.cadence.SignalExternalWorkflowExecutionFailedCause;
|
30 | 29 | import com.uber.cadence.TimeoutType;
|
31 | 30 | import com.uber.cadence.WorkflowExecution;
|
|
60 | 59 | import java.io.IOException;
|
61 | 60 | import java.lang.reflect.Type;
|
62 | 61 | import java.time.Duration;
|
63 |
| -import java.util.ArrayDeque; |
64 |
| -import java.util.ArrayList; |
65 |
| -import java.util.Arrays; |
66 |
| -import java.util.Collections; |
67 |
| -import java.util.HashMap; |
68 |
| -import java.util.HashSet; |
69 |
| -import java.util.List; |
70 |
| -import java.util.Map; |
71 |
| -import java.util.Objects; |
72 |
| -import java.util.Optional; |
73 |
| -import java.util.Queue; |
74 |
| -import java.util.Random; |
75 |
| -import java.util.Set; |
76 |
| -import java.util.UUID; |
| 62 | +import java.util.*; |
77 | 63 | import java.util.concurrent.CancellationException;
|
78 | 64 | import java.util.concurrent.CompletableFuture;
|
79 | 65 | import java.util.concurrent.ExecutionException;
|
|
99 | 85 | import org.junit.rules.Timeout;
|
100 | 86 | import org.junit.runner.Description;
|
101 | 87 | import org.junit.runner.RunWith;
|
| 88 | +import org.junit.runners.Parameterized; |
102 | 89 | import org.junit.runners.Parameterized.Parameter;
|
103 | 90 | import org.junit.runners.Parameterized.Parameters;
|
104 | 91 | import org.slf4j.Logger;
|
105 | 92 | import org.slf4j.LoggerFactory;
|
106 | 93 |
|
107 |
| -@RunWith(ParallelParameterized.class) |
| 94 | +@RunWith(Parameterized.class) |
108 | 95 | public class WorkflowTest {
|
109 | 96 |
|
110 | 97 | /**
|
@@ -132,7 +119,7 @@ public static Object[] data() {
|
132 | 119 |
|
133 | 120 | @Rule
|
134 | 121 | public Timeout globalTimeout =
|
135 |
| - Timeout.seconds(DEBUGGER_TIMEOUTS ? 500 : (skipDockerService ? 3 : 20)); |
| 122 | + Timeout.seconds(DEBUGGER_TIMEOUTS ? 500 : (skipDockerService ? 5 : 20)); |
136 | 123 |
|
137 | 124 | @Rule
|
138 | 125 | public TestWatcher watchman =
|
@@ -251,7 +238,7 @@ public void setUp() {
|
251 | 238 |
|
252 | 239 | @After
|
253 | 240 | public void tearDown() throws Throwable {
|
254 |
| - worker.shutdown(Duration.ofMillis(1)); |
| 241 | + worker.shutdown(Duration.ofMinutes(1)); |
255 | 242 | activitiesImpl.close();
|
256 | 243 | if (testEnvironment != null) {
|
257 | 244 | testEnvironment.close();
|
@@ -2581,14 +2568,15 @@ private static class TestActivitiesImpl implements TestActivities {
|
2581 | 2568 | final List<String> invocations = Collections.synchronizedList(new ArrayList<>());
|
2582 | 2569 | final List<String> procResult = Collections.synchronizedList(new ArrayList<>());
|
2583 | 2570 | private final ThreadPoolExecutor executor =
|
2584 |
| - new ThreadPoolExecutor(2, 100, 1, TimeUnit.MINUTES, new LinkedBlockingQueue<>()); |
| 2571 | + new ThreadPoolExecutor(0, 100, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<>()); |
2585 | 2572 |
|
2586 | 2573 | private TestActivitiesImpl(ActivityCompletionClient completionClient) {
|
2587 | 2574 | this.completionClient = completionClient;
|
2588 | 2575 | }
|
2589 | 2576 |
|
2590 |
| - void close() { |
2591 |
| - executor.shutdown(); |
| 2577 | + void close() throws InterruptedException { |
| 2578 | + executor.shutdownNow(); |
| 2579 | + executor.awaitTermination(1, TimeUnit.MINUTES); |
2592 | 2580 | }
|
2593 | 2581 |
|
2594 | 2582 | void assertInvocations(String... expected) {
|
|
0 commit comments