109
109
import org .junit .jupiter .params .ParameterizedTest ;
110
110
import org .junit .jupiter .params .provider .Arguments ;
111
111
import org .junit .jupiter .params .provider .MethodSource ;
112
- import org .junit .jupiter .params .provider .ValueSource ;
113
112
import org .mockito .InOrder ;
114
113
import org .mockito .Mock ;
115
114
import org .mockito .Mockito ;
@@ -917,7 +916,6 @@ public void shouldRespectNumIterationsInMainLoopWithoutProcessingThreads(final b
917
916
thread = createStreamThread (CLIENT_ID , config );
918
917
919
918
thread .setState (StreamThread .State .STARTING );
920
- thread .taskManager ().init ();
921
919
thread .setState (StreamThread .State .PARTITIONS_REVOKED );
922
920
923
921
final TaskId task1 = new TaskId (0 , t1p1 .partition ());
@@ -1291,7 +1289,6 @@ public void shouldInjectProducerPerThreadUsingClientSupplierOnCreateIfEosV2Enabl
1291
1289
thread = createStreamThread (CLIENT_ID , new StreamsConfig (props ));
1292
1290
1293
1291
thread .setState (StreamThread .State .STARTING );
1294
- thread .taskManager ().init ();
1295
1292
thread .rebalanceListener ().onPartitionsRevoked (Collections .emptyList ());
1296
1293
1297
1294
final Map <TaskId , Set <TopicPartition >> activeTasks = new HashMap <>();
@@ -1549,7 +1546,6 @@ public void shouldNotCloseTaskAndRemoveFromTaskManagerIfProducerWasFencedWhilePr
1549
1546
consumer .updatePartitions (topic1 , Collections .singletonList (new PartitionInfo (topic1 , 1 , null , null , null )));
1550
1547
1551
1548
thread .setState (StreamThread .State .STARTING );
1552
- thread .taskManager ().init ();
1553
1549
thread .rebalanceListener ().onPartitionsRevoked (Collections .emptySet ());
1554
1550
1555
1551
final Map <TaskId , Set <TopicPartition >> activeTasks = new HashMap <>();
@@ -1615,7 +1611,6 @@ private void testThrowingDurringCommitTransactionException(final RuntimeExceptio
1615
1611
internalTopologyBuilder .addSink ("out" , "output" , null , null , null , "name" );
1616
1612
1617
1613
thread .setState (StreamThread .State .STARTING );
1618
- thread .taskManager ().init ();
1619
1614
thread .rebalanceListener ().onPartitionsRevoked (Collections .emptySet ());
1620
1615
1621
1616
final Map <TaskId , Set <TopicPartition >> activeTasks = new HashMap <>();
@@ -1698,7 +1693,6 @@ public void shouldReinitializeRevivedTasksInAnyState(final boolean stateUpdaterE
1698
1693
internalTopologyBuilder .buildTopology ();
1699
1694
1700
1695
thread .setState (StreamThread .State .STARTING );
1701
- thread .taskManager ().init ();
1702
1696
thread .rebalanceListener ().onPartitionsRevoked (Collections .emptySet ());
1703
1697
1704
1698
final Map <TaskId , Set <TopicPartition >> activeTasks = new HashMap <>();
@@ -1793,7 +1787,6 @@ private void testNotCloseTaskAndRemoveFromTaskManagerInCommitTransactionWhenComm
1793
1787
consumer .updatePartitions (topic1 , Collections .singletonList (new PartitionInfo (topic1 , 1 , null , null , null )));
1794
1788
1795
1789
thread .setState (StreamThread .State .STARTING );
1796
- thread .taskManager ().init ();
1797
1790
thread .rebalanceListener ().onPartitionsRevoked (Collections .emptySet ());
1798
1791
1799
1792
final Map <TaskId , Set <TopicPartition >> activeTasks = new HashMap <>();
@@ -1858,7 +1851,6 @@ public void shouldNotCloseTaskProducerWhenSuspending(final boolean stateUpdaterE
1858
1851
internalTopologyBuilder .addSink ("out" , "output" , null , null , null , "name" );
1859
1852
1860
1853
thread .setState (StreamThread .State .STARTING );
1861
- thread .taskManager ().init ();
1862
1854
thread .rebalanceListener ().onPartitionsRevoked (Collections .emptySet ());
1863
1855
1864
1856
final Map <TaskId , Set <TopicPartition >> activeTasks = new HashMap <>();
@@ -1940,7 +1932,6 @@ public void shouldReturnActiveTaskMetadataWhileRunningState(final boolean stateU
1940
1932
);
1941
1933
1942
1934
thread .setState (StreamThread .State .STARTING );
1943
- thread .taskManager ().init ();
1944
1935
thread .rebalanceListener ().onPartitionsRevoked (Collections .emptySet ());
1945
1936
1946
1937
final Map <TaskId , Set <TopicPartition >> activeTasks = new HashMap <>();
@@ -2001,7 +1992,6 @@ public void shouldReturnStandbyTaskMetadataWhileRunningState(final boolean state
2001
1992
restoreConsumer .updateBeginningOffsets (offsets );
2002
1993
2003
1994
thread .setState (StreamThread .State .STARTING );
2004
- thread .taskManager ().init ();
2005
1995
thread .rebalanceListener ().onPartitionsRevoked (Collections .emptySet ());
2006
1996
2007
1997
final Map <TaskId , Set <TopicPartition >> standbyTasks = new HashMap <>();
@@ -2265,7 +2255,6 @@ public void process(final Record<Object, Object> record) {}
2265
2255
thread = createStreamThread (CLIENT_ID , config );
2266
2256
2267
2257
thread .setState (StreamThread .State .STARTING );
2268
- thread .taskManager ().init ();
2269
2258
thread .rebalanceListener ().onPartitionsRevoked (Collections .emptySet ());
2270
2259
final List <TopicPartition > assignedPartitions = new ArrayList <>();
2271
2260
@@ -2345,7 +2334,6 @@ public void process(final Record<Object, Object> record) {}
2345
2334
thread = createStreamThread (CLIENT_ID , stateUpdaterEnabled , processingThreadsEnabled );
2346
2335
2347
2336
thread .setState (StreamThread .State .STARTING );
2348
- thread .taskManager ().init ();
2349
2337
thread .rebalanceListener ().onPartitionsRevoked (Collections .emptySet ());
2350
2338
final List <TopicPartition > assignedPartitions = new ArrayList <>();
2351
2339
@@ -2543,7 +2531,6 @@ public void shouldLogAndRecordSkippedMetricForDeserializationException(final boo
2543
2531
thread = createStreamThread (CLIENT_ID , new StreamsConfig (properties ));
2544
2532
2545
2533
thread .setState (StreamThread .State .STARTING );
2546
- thread .taskManager ().init ();
2547
2534
thread .setState (StreamThread .State .PARTITIONS_REVOKED );
2548
2535
2549
2536
final TaskId task1 = new TaskId (0 , t1p1 .partition ());
@@ -3030,7 +3017,6 @@ public void shouldLogAndRecordSkippedRecordsForInvalidTimestamps(
3030
3017
thread = createStreamThread (CLIENT_ID , config );
3031
3018
3032
3019
thread .setState (StreamThread .State .STARTING );
3033
- thread .taskManager ().init ();
3034
3020
thread .setState (StreamThread .State .PARTITIONS_REVOKED );
3035
3021
3036
3022
final TaskId task1 = new TaskId (0 , t1p1 .partition ());
@@ -3404,7 +3390,6 @@ private void getClientInstanceId(final boolean injectTimeException, final boolea
3404
3390
3405
3391
thread = createStreamThread ("clientId" , stateUpdaterEnabled , processingThreadsEnabled );
3406
3392
thread .setState (State .STARTING );
3407
- thread .taskManager ().init ();
3408
3393
3409
3394
final Map <String , KafkaFuture <Uuid >> clientInstanceIdFutures = thread .clientInstanceIds (Duration .ZERO );
3410
3395
@@ -3429,7 +3414,6 @@ private void getClientInstanceId(final boolean injectTimeException, final boolea
3429
3414
public void shouldReturnErrorIfMainConsumerInstanceIdNotInitialized (final boolean stateUpdaterEnabled , final boolean processingThreadsEnabled ) {
3430
3415
thread = createStreamThread ("clientId" , stateUpdaterEnabled , processingThreadsEnabled );
3431
3416
thread .setState (State .STARTING );
3432
- thread .taskManager ().init ();
3433
3417
3434
3418
final Map <String , KafkaFuture <Uuid >> consumerFutures = thread .clientInstanceIds (Duration .ZERO );
3435
3419
@@ -3446,7 +3430,6 @@ public void shouldReturnErrorIfMainConsumerInstanceIdNotInitialized(final boolea
3446
3430
public void shouldReturnErrorIfRestoreConsumerInstanceIdNotInitialized (final boolean stateUpdaterEnabled , final boolean processingThreadsEnabled ) {
3447
3431
thread = createStreamThread ("clientId" , stateUpdaterEnabled , processingThreadsEnabled );
3448
3432
thread .setState (State .STARTING );
3449
- thread .taskManager ().init ();
3450
3433
3451
3434
final Map <String , KafkaFuture <Uuid >> consumerFutures = thread .clientInstanceIds (Duration .ZERO );
3452
3435
@@ -3463,7 +3446,6 @@ public void shouldReturnErrorIfRestoreConsumerInstanceIdNotInitialized(final boo
3463
3446
public void shouldReturnErrorIfProducerInstanceIdNotInitialized (final boolean stateUpdaterEnabled , final boolean processingThreadsEnabled ) {
3464
3447
thread = createStreamThread ("clientId" , stateUpdaterEnabled , processingThreadsEnabled );
3465
3448
thread .setState (State .STARTING );
3466
- thread .taskManager ().init ();
3467
3449
3468
3450
final Map <String , KafkaFuture <Uuid >> producerFutures = thread .clientInstanceIds (Duration .ZERO );
3469
3451
@@ -3481,7 +3463,6 @@ public void shouldReturnNullIfMainConsumerTelemetryDisabled(final boolean stateU
3481
3463
clientSupplier .consumer .disableTelemetry ();
3482
3464
thread = createStreamThread ("clientId" , stateUpdaterEnabled , processingThreadsEnabled );
3483
3465
thread .setState (State .STARTING );
3484
- thread .taskManager ().init ();
3485
3466
3486
3467
final Map <String , KafkaFuture <Uuid >> consumerFutures = thread .clientInstanceIds (Duration .ZERO );
3487
3468
@@ -3499,7 +3480,6 @@ public void shouldReturnNullIfRestoreConsumerTelemetryDisabled(final boolean sta
3499
3480
3500
3481
thread = createStreamThread ("clientId" , stateUpdaterEnabled , processingThreadsEnabled );
3501
3482
thread .setState (State .STARTING );
3502
- thread .taskManager ().init ();
3503
3483
3504
3484
final Map <String , KafkaFuture <Uuid >> consumerFutures = thread .clientInstanceIds (Duration .ZERO );
3505
3485
@@ -3519,7 +3499,6 @@ public void shouldReturnNullIfProducerTelemetryDisabled(final boolean stateUpdat
3519
3499
3520
3500
thread = createStreamThread ("clientId" , stateUpdaterEnabled , processingThreadsEnabled );
3521
3501
thread .setState (State .STARTING );
3522
- thread .taskManager ().init ();
3523
3502
3524
3503
final Map <String , KafkaFuture <Uuid >> producerFutures = thread .clientInstanceIds (Duration .ZERO );
3525
3504
@@ -3537,7 +3516,6 @@ public void shouldTimeOutOnMainConsumerInstanceId(final boolean stateUpdaterEnab
3537
3516
clientSupplier .consumer .injectTimeoutException (-1 );
3538
3517
thread = createStreamThread ("clientId" , stateUpdaterEnabled , processingThreadsEnabled );
3539
3518
thread .setState (State .STARTING );
3540
- thread .taskManager ().init ();
3541
3519
3542
3520
final Map <String , KafkaFuture <Uuid >> consumerFutures = thread .clientInstanceIds (Duration .ZERO );
3543
3521
@@ -3562,7 +3540,6 @@ public void shouldTimeOutOnRestoreConsumerInstanceId(final boolean stateUpdaterE
3562
3540
clientSupplier .restoreConsumer .injectTimeoutException (-1 );
3563
3541
thread = createStreamThread ("clientId" , stateUpdaterEnabled , processingThreadsEnabled );
3564
3542
thread .setState (State .STARTING );
3565
- thread .taskManager ().init ();
3566
3543
3567
3544
final Map <String , KafkaFuture <Uuid >> consumerFutures = thread .clientInstanceIds (Duration .ZERO );
3568
3545
@@ -3590,7 +3567,6 @@ public void shouldTimeOutOnProducerInstanceId(final boolean stateUpdaterEnabled,
3590
3567
3591
3568
thread = createStreamThread ("clientId" , stateUpdaterEnabled , processingThreadsEnabled );
3592
3569
thread .setState (State .STARTING );
3593
- thread .taskManager ().init ();
3594
3570
3595
3571
final Map <String , KafkaFuture <Uuid >> producerFutures = thread .clientInstanceIds (Duration .ZERO );
3596
3572
@@ -3607,10 +3583,9 @@ public void shouldTimeOutOnProducerInstanceId(final boolean stateUpdaterEnabled,
3607
3583
);
3608
3584
}
3609
3585
3610
- @ ParameterizedTest
3611
- @ ValueSource (booleans = {true , false })
3612
- public void testNamedTopologyWithStreamsProtocol (final boolean stateUpdaterEnabled ) {
3613
- final Properties props = configProps (false , stateUpdaterEnabled , false );
3586
+ @ Test
3587
+ public void testNamedTopologyWithStreamsProtocol () {
3588
+ final Properties props = configProps (false , false , false );
3614
3589
props .setProperty (StreamsConfig .GROUP_PROTOCOL_CONFIG , GroupProtocol .STREAMS .toString ());
3615
3590
final StreamsConfig config = new StreamsConfig (props );
3616
3591
final InternalTopologyBuilder topologyBuilder = new InternalTopologyBuilder (
@@ -3667,10 +3642,9 @@ public void testStreamsRebalanceDataWithClassicProtocol() {
3667
3642
assertTrue (thread .streamsRebalanceData ().isEmpty ());
3668
3643
}
3669
3644
3670
- @ ParameterizedTest
3671
- @ ValueSource (booleans = {true , false })
3672
- public void testStreamsRebalanceDataWithExtraCopartition (final boolean stateUpdaterEnabled ) {
3673
- final Properties props = configProps (false , stateUpdaterEnabled , false );
3645
+ @ Test
3646
+ public void testStreamsRebalanceDataWithExtraCopartition () {
3647
+ final Properties props = configProps (false , false , false );
3674
3648
props .setProperty (StreamsConfig .GROUP_PROTOCOL_CONFIG , GroupProtocol .STREAMS .toString ());
3675
3649
3676
3650
internalTopologyBuilder .addSource (null , "source1" , null , null , null , topic1 );
0 commit comments