@@ -28,9 +28,9 @@ import org.apache.kafka.server.config.ServerLogConfigs
28
28
import org .apache .kafka .server .log .remote .storage .{NoOpRemoteLogMetadataManager , NoOpRemoteStorageManager , RemoteLogManagerConfig , RemoteLogSegmentId , RemoteLogSegmentMetadata , RemoteLogSegmentState }
29
29
import org .junit .jupiter .api .Assertions ._
30
30
import org .junit .jupiter .api .function .Executable
31
- import org .junit .jupiter .api .{BeforeEach , Tag , TestInfo }
31
+ import org .junit .jupiter .api .{BeforeEach , Tag , Test , TestInfo }
32
32
import org .junit .jupiter .params .ParameterizedTest
33
- import org .junit .jupiter .params .provider .{ CsvSource , ValueSource }
33
+ import org .junit .jupiter .params .provider .CsvSource
34
34
35
35
import java .util
36
36
import java .util .concurrent .atomic .AtomicInteger
@@ -73,9 +73,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
73
73
testTopicName = s " ${info.getTestMethod.get().getName}- ${Random .alphanumeric.take(10 ).mkString}"
74
74
}
75
75
76
- @ ParameterizedTest
77
- @ ValueSource (strings = Array (" kraft" ))
78
- def testCreateRemoteTopicWithValidRetentionTime (quorum : String ): Unit = {
76
+ @ Test
77
+ def testCreateRemoteTopicWithValidRetentionTime (): Unit = {
79
78
val topicConfig = new Properties ()
80
79
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
81
80
topicConfig.put(TopicConfig .RETENTION_MS_CONFIG , " 200" )
@@ -85,9 +84,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
85
84
verifyRemoteLogTopicConfigs(topicConfig)
86
85
}
87
86
88
- @ ParameterizedTest
89
- @ ValueSource (strings = Array (" kraft" ))
90
- def testCreateRemoteTopicWithValidRetentionSize (quorum : String ): Unit = {
87
+ @ Test
88
+ def testCreateRemoteTopicWithValidRetentionSize (): Unit = {
91
89
val topicConfig = new Properties ()
92
90
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
93
91
topicConfig.put(TopicConfig .RETENTION_BYTES_CONFIG , " 512" )
@@ -97,9 +95,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
97
95
verifyRemoteLogTopicConfigs(topicConfig)
98
96
}
99
97
100
- @ ParameterizedTest
101
- @ ValueSource (strings = Array (" kraft" ))
102
- def testCreateRemoteTopicWithInheritedLocalRetentionTime (quorum : String ): Unit = {
98
+ @ Test
99
+ def testCreateRemoteTopicWithInheritedLocalRetentionTime (): Unit = {
103
100
// inherited local retention ms is 1000
104
101
val topicConfig = new Properties ()
105
102
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
@@ -109,9 +106,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
109
106
verifyRemoteLogTopicConfigs(topicConfig)
110
107
}
111
108
112
- @ ParameterizedTest
113
- @ ValueSource (strings = Array (" kraft" ))
114
- def testCreateRemoteTopicWithInheritedLocalRetentionSize (quorum : String ): Unit = {
109
+ @ Test
110
+ def testCreateRemoteTopicWithInheritedLocalRetentionSize (): Unit = {
115
111
// inherited local retention bytes is 1024
116
112
val topicConfig = new Properties ()
117
113
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
@@ -121,9 +117,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
121
117
verifyRemoteLogTopicConfigs(topicConfig)
122
118
}
123
119
124
- @ ParameterizedTest
125
- @ ValueSource (strings = Array (" kraft" ))
126
- def testCreateRemoteTopicWithInvalidRetentionTime (quorum : String ): Unit = {
120
+ @ Test
121
+ def testCreateRemoteTopicWithInvalidRetentionTime (): Unit = {
127
122
// inherited local retention ms is 1000
128
123
val topicConfig = new Properties ()
129
124
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
@@ -133,9 +128,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
133
128
topicConfig = topicConfig))
134
129
}
135
130
136
- @ ParameterizedTest
137
- @ ValueSource (strings = Array (" kraft" ))
138
- def testCreateRemoteTopicWithInvalidRetentionSize (quorum : String ): Unit = {
131
+ @ Test
132
+ def testCreateRemoteTopicWithInvalidRetentionSize (): Unit = {
139
133
// inherited local retention bytes is 1024
140
134
val topicConfig = new Properties ()
141
135
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
@@ -145,9 +139,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
145
139
topicConfig = topicConfig))
146
140
}
147
141
148
- @ ParameterizedTest
149
- @ ValueSource (strings = Array (" kraft" ))
150
- def testCreateCompactedRemoteStorage (quorum : String ): Unit = {
142
+ @ Test
143
+ def testCreateCompactedRemoteStorage (): Unit = {
151
144
val topicConfig = new Properties ()
152
145
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
153
146
topicConfig.put(TopicConfig .CLEANUP_POLICY_CONFIG , " compact" )
@@ -158,8 +151,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
158
151
159
152
// `remote.log.delete.on.disable` and `remote.log.copy.disable` only works in KRaft mode.
160
153
@ ParameterizedTest
161
- @ CsvSource (Array (" kraft, true,true" , " kraft, true,false" , " kraft, false,true" , " kraft, false,false" ))
162
- def testCreateRemoteTopicWithCopyDisabledAndDeleteOnDisable (quorum : String , copyDisabled : Boolean , deleteOnDisable : Boolean ): Unit = {
154
+ @ CsvSource (Array (" true,true" , " true,false" , " false,true" , " false,false" ))
155
+ def testCreateRemoteTopicWithCopyDisabledAndDeleteOnDisable (copyDisabled : Boolean , deleteOnDisable : Boolean ): Unit = {
163
156
val topicConfig = new Properties ()
164
157
topicConfig.put(TopicConfig .REMOTE_LOG_COPY_DISABLE_CONFIG , copyDisabled.toString)
165
158
topicConfig.put(TopicConfig .REMOTE_LOG_DELETE_ON_DISABLE_CONFIG , deleteOnDisable.toString)
@@ -169,9 +162,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
169
162
}
170
163
171
164
// `remote.log.delete.on.disable` only works in KRaft mode.
172
- @ ParameterizedTest
173
- @ ValueSource (strings = Array (" kraft" ))
174
- def testCreateTopicRetentionMsValidationWithRemoteCopyDisabled (quorum : String ): Unit = {
165
+ @ Test
166
+ def testCreateTopicRetentionMsValidationWithRemoteCopyDisabled (): Unit = {
175
167
val testTopicName2 = testTopicName + " 2"
176
168
val testTopicName3 = testTopicName + " 3"
177
169
val errorMsgMs = " When `remote.log.copy.disable` is set to true, the `local.retention.ms` and `retention.ms` " +
@@ -235,9 +227,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
235
227
admin.incrementalAlterConfigs(configs).all().get()
236
228
}
237
229
238
- @ ParameterizedTest
239
- @ ValueSource (strings = Array (" kraft" ))
240
- def testCreateTopicRetentionBytesValidationWithRemoteCopyDisabled (quorum : String ): Unit = {
230
+ @ Test
231
+ def testCreateTopicRetentionBytesValidationWithRemoteCopyDisabled (): Unit = {
241
232
val testTopicName2 = testTopicName + " 2"
242
233
val testTopicName3 = testTopicName + " 3"
243
234
val errorMsgBytes = " When `remote.log.copy.disable` is set to true, the `local.retention.bytes` and `retention.bytes` " +
@@ -300,9 +291,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
300
291
admin.incrementalAlterConfigs(configs).all().get()
301
292
}
302
293
303
- @ ParameterizedTest
304
- @ ValueSource (strings = Array (" kraft" ))
305
- def testEnableRemoteLogOnExistingTopicTest (quorum : String ): Unit = {
294
+ @ Test
295
+ def testEnableRemoteLogOnExistingTopicTest (): Unit = {
306
296
val admin = createAdminClient()
307
297
val topicConfig = new Properties ()
308
298
TestUtils .createTopicWithAdmin(admin, testTopicName, brokers, controllerServers, numPartitions, numReplicationFactor,
@@ -318,9 +308,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
318
308
verifyRemoteLogTopicConfigs(topicConfig)
319
309
}
320
310
321
- @ ParameterizedTest
322
- @ ValueSource (strings = Array (" kraft" ))
323
- def testEnableRemoteLogWhenSystemRemoteStorageIsDisabled (quorum : String ): Unit = {
311
+ @ Test
312
+ def testEnableRemoteLogWhenSystemRemoteStorageIsDisabled (): Unit = {
324
313
val admin = createAdminClient()
325
314
326
315
val topicConfigWithRemoteStorage = new Properties ()
@@ -342,9 +331,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
342
331
assertTrue(errorMessage.getMessage.contains(" Tiered Storage functionality is disabled in the broker" ))
343
332
}
344
333
345
- @ ParameterizedTest
346
- @ ValueSource (strings = Array (" kraft" ))
347
- def testUpdateTopicConfigWithValidRetentionTimeTest (quorum : String ): Unit = {
334
+ @ Test
335
+ def testUpdateTopicConfigWithValidRetentionTimeTest (): Unit = {
348
336
val admin = createAdminClient()
349
337
val topicConfig = new Properties ()
350
338
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
@@ -363,9 +351,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
363
351
verifyRemoteLogTopicConfigs(topicConfig)
364
352
}
365
353
366
- @ ParameterizedTest
367
- @ ValueSource (strings = Array (" kraft" ))
368
- def testUpdateTopicConfigWithValidRetentionSizeTest (quorum : String ): Unit = {
354
+ @ Test
355
+ def testUpdateTopicConfigWithValidRetentionSizeTest (): Unit = {
369
356
val admin = createAdminClient()
370
357
val topicConfig = new Properties ()
371
358
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
@@ -384,9 +371,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
384
371
verifyRemoteLogTopicConfigs(topicConfig)
385
372
}
386
373
387
- @ ParameterizedTest
388
- @ ValueSource (strings = Array (" kraft" ))
389
- def testUpdateTopicConfigWithInheritedLocalRetentionTime (quorum : String ): Unit = {
374
+ @ Test
375
+ def testUpdateTopicConfigWithInheritedLocalRetentionTime (): Unit = {
390
376
val admin = createAdminClient()
391
377
val topicConfig = new Properties ()
392
378
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
@@ -404,9 +390,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
404
390
() => admin.incrementalAlterConfigs(configs).all().get())
405
391
}
406
392
407
- @ ParameterizedTest
408
- @ ValueSource (strings = Array (" kraft" ))
409
- def testUpdateTopicConfigWithInheritedLocalRetentionSize (quorum : String ): Unit = {
393
+ @ Test
394
+ def testUpdateTopicConfigWithInheritedLocalRetentionSize (): Unit = {
410
395
val admin = createAdminClient()
411
396
val topicConfig = new Properties ()
412
397
topicConfig.put(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
@@ -425,9 +410,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
425
410
}
426
411
427
412
// The remote storage config validation on controller level only works in KRaft
428
- @ ParameterizedTest
429
- @ ValueSource (strings = Array (" kraft" ))
430
- def testUpdateTopicConfigWithDisablingRemoteStorage (quorum : String ): Unit = {
413
+ @ Test
414
+ def testUpdateTopicConfigWithDisablingRemoteStorage (): Unit = {
431
415
val admin = createAdminClient()
432
416
val topicConfig = new Properties
433
417
topicConfig.setProperty(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
@@ -446,9 +430,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
446
430
" If you want to disable remote storage and delete all remote data, please set `remote.storage.enable=false,remote.log.delete.on.disable=true`." )
447
431
}
448
432
449
- @ ParameterizedTest
450
- @ ValueSource (strings = Array (" kraft" ))
451
- def testUpdateTopicConfigWithDisablingRemoteStorageWithDeleteOnDisable (quorum : String ): Unit = {
433
+ @ Test
434
+ def testUpdateTopicConfigWithDisablingRemoteStorageWithDeleteOnDisable (): Unit = {
452
435
val admin = createAdminClient()
453
436
val topicConfig = new Properties
454
437
topicConfig.setProperty(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
@@ -473,9 +456,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
473
456
verifyRemoteLogTopicConfigs(newProps)
474
457
}
475
458
476
- @ ParameterizedTest
477
- @ ValueSource (strings = Array (" kraft" ))
478
- def testTopicDeletion (quorum : String ): Unit = {
459
+ @ Test
460
+ def testTopicDeletion (): Unit = {
479
461
MyRemoteStorageManager .deleteSegmentEventCounter.set(0 )
480
462
val numPartitions = 2
481
463
val topicConfig = new Properties ()
@@ -492,9 +474,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
492
474
" Remote log segments should be deleted only once by the leader" )
493
475
}
494
476
495
- @ ParameterizedTest
496
- @ ValueSource (strings = Array (" kraft" ))
497
- def testClusterWideDisablementOfTieredStorageWithEnabledTieredTopic (quorum : String ): Unit = {
477
+ @ Test
478
+ def testClusterWideDisablementOfTieredStorageWithEnabledTieredTopic (): Unit = {
498
479
val topicConfig = new Properties ()
499
480
topicConfig.setProperty(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , " true" )
500
481
@@ -510,9 +491,8 @@ class RemoteTopicCrudTest extends IntegrationTestHarness {
510
491
faultHandler.setIgnore(true )
511
492
}
512
493
513
- @ ParameterizedTest
514
- @ ValueSource (strings = Array (" kraft" ))
515
- def testClusterWithoutTieredStorageStartsSuccessfullyIfTopicWithTieringDisabled (quorum : String ): Unit = {
494
+ @ Test
495
+ def testClusterWithoutTieredStorageStartsSuccessfullyIfTopicWithTieringDisabled (): Unit = {
516
496
val topicConfig = new Properties ()
517
497
topicConfig.setProperty(TopicConfig .REMOTE_LOG_STORAGE_ENABLE_CONFIG , false .toString)
518
498
0 commit comments