@ -197,7 +200,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
@@ -197,7 +200,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
workerTask.initialize(TASK_CONFIG);
executor.submit(workerTask);
awaitPolls(pollLatch);
awaitLatch(pollLatch);
workerTask.transitionTo(TargetState.PAUSED);
@ -238,7 +241,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
@@ -238,7 +241,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
workerTask.initialize(TASK_CONFIG);
executor.submit(workerTask);
awaitPolls(pollLatch);
awaitLatch(pollLatch);
workerTask.stop();
assertTrue(workerTask.awaitStop(1000));
@ -271,7 +274,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
@@ -271,7 +274,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
workerTask.initialize(TASK_CONFIG);
executor.submit(workerTask);
awaitPolls(pollLatch);
awaitLatch(pollLatch);
workerTask.stop();
assertTrue(workerTask.awaitStop(1000));
@ -306,7 +309,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
@@ -306,7 +309,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
workerTask.initialize(TASK_CONFIG);
executor.submit(workerTask);
awaitPolls(pollLatch);
awaitLatch(pollLatch);
assertTrue(workerTask.commitOffsets());
workerTask.stop();
assertTrue(workerTask.awaitStop(1000));
@ -341,7 +344,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
@@ -341,7 +344,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
workerTask.initialize(TASK_CONFIG);
executor.submit(workerTask);
awaitPolls(pollLatch);
awaitLatch(pollLatch);
assertTrue(workerTask.commitOffsets());
workerTask.stop();
assertTrue(workerTask.awaitStop(1000));
@ -403,6 +406,30 @@ public class WorkerSourceTaskTest extends ThreadedTest {
@@ -403,6 +406,30 @@ public class WorkerSourceTaskTest extends ThreadedTest {
@ -435,7 +462,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
@@ -435,7 +462,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
// Stopping immediately while the other thread has work to do should result in no polling, no offset commits,
// exiting the work thread immediately, and the stop() method will be invoked in the background thread since it
// cannot be invoked immediately in the thread trying to stop the task.
startupLatch.await(1000,TimeUnit.MILLISECONDS);
awaitLatch(startupLatch);
workerTask.stop();
assertTrue(workerTask.awaitStop(1000));
@ -479,14 +506,22 @@ public class WorkerSourceTaskTest extends ThreadedTest {
@@ -479,14 +506,22 @@ public class WorkerSourceTaskTest extends ThreadedTest {
@ -523,11 +558,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
@@ -523,11 +558,7 @@ public class WorkerSourceTaskTest extends ThreadedTest {
expect.andAnswer(expectResponse);
// 3. As a result of a successful producer send callback, we'll notify the source task of the record commit
@ -545,8 +576,24 @@ public class WorkerSourceTaskTest extends ThreadedTest {
@@ -545,8 +576,24 @@ public class WorkerSourceTaskTest extends ThreadedTest {