Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
632 lines (594 loc) · 32.1 KB
/
Copy pathbuild.gradle
File metadata and controls
632 lines (594 loc) · 32.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
plugins {
id 'java'
id 'org.springframework.boot' version '3.5.16'
}
group = 'dev.jinhyeon'
version = '0.3.0-SNAPSHOT'
description = 'Local notification delivery and traffic-management learning project'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
dependencies {
// Keep the existing Spring Boot BOM versions during the build-tool migration.
implementation enforcedPlatform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'org.springframework.batch:spring-batch-core'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.kafka:spring-kafka'
implementation 'org.apache.httpcomponents.client5:httpclient5'
implementation 'redis.clients:jedis'
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-mysql'
implementation 'io.micrometer:micrometer-registry-prometheus'
implementation 'com.mysql:mysql-connector-j'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
// Tests use real objects and hand-written fakes; no JVM attach agent is needed.
exclude group: 'org.mockito', module: 'mockito-core'
exclude group: 'org.mockito', module: 'mockito-junit-jupiter'
}
testImplementation 'org.testcontainers:kafka'
testImplementation 'org.testcontainers:mysql'
testImplementation 'org.testcontainers:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
tasks.withType(Test).configureEach {
systemProperty 'mock.http.idempotency-file', ':memory:'
}
tasks.named('test') {
useJUnitPlatform { excludeTags 'reconciliation', 'campaign-load', 'campaign-delivery-pilot', 'producer-batching-pilot', 'outbox-query-probe', 'outbox-statistics-probe', 'outbox-lock-probe', 'api-wait-probe', 'api-failure-persistence', 'api-failure-pilot-controls' }
// Provisioning lives outside Java resources; edits must invalidate the monitoring regression.
inputs.files(fileTree('monitoring') { include '**/*.yml', '**/*.json' }, file('compose.monitoring.yml'))
.withPropertyName('monitoringConfiguration').withPathSensitivity(PathSensitivity.RELATIVE)
inputs.files(file('deploy/local/haproxy.cfg'), file('compose.topology.yml'))
.withPropertyName('topologyConfiguration').withPathSensitivity(PathSensitivity.RELATIVE)
doFirst {
// The process-crash experiment forks a test-only Spring Boot entry point.
systemProperty 'notificationLab.testClasspath', sourceSets.test.runtimeClasspath.asPath
}
testLogging {
events 'passed', 'skipped', 'failed'
}
}
// This repository distributes an executable Spring Boot application, not a library.
tasks.named('jar') {
enabled = false
}
// Explicit 10,000-request correctness experiment; kept out of the fast regression suite.
tasks.register('reconciliationTest', Test) {
description = 'Reconcile 10,000 HTTP requests through real MySQL and Kafka'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'reconciliation' }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
shouldRunAfter test
}
// Standalone local HTTP provider simulator; excluded from the notification application's JAR/scan.
sourceSets {
mockServer
}
configurations {
mockServerImplementation.extendsFrom implementation
mockServerRuntimeOnly.extendsFrom runtimeOnly
}
dependencies {
testImplementation sourceSets.mockServer.output
mockServerRuntimeOnly 'com.h2database:h2'
testRuntimeOnly 'com.h2database:h2'
}
tasks.register('mockServer', JavaExec) {
group = 'application'
description = 'Run the local HTTP mock provider on 127.0.0.1:18081'
classpath = sourceSets.mockServer.runtimeClasspath
mainClass = 'dev.jinhyeon.notificationmock.MockServerApplication'
}
tasks.register('mockServerJar', org.springframework.boot.gradle.tasks.bundling.BootJar) {
group = 'build'
archiveClassifier = 'http-mock'
targetJavaVersion = JavaVersion.VERSION_21
mainClass = 'dev.jinhyeon.notificationmock.MockServerApplication'
classpath = sourceSets.mockServer.runtimeClasspath
}
tasks.named('assemble') { dependsOn tasks.named('mockServerJar') }
// Explicit single-campaign expansion; bootRun never launches a campaign job automatically.
tasks.register('campaignBatch', JavaExec) {
group = 'application'
description = 'Expand one START_REQUESTED campaign into durable Outbox work'
classpath = sourceSets.main.runtimeClasspath
mainClass = 'dev.jinhyeon.notificationlab.campaign.batch.CampaignBatchCommand'
}
springBoot {
mainClass = 'dev.jinhyeon.notificationlab.NotificationLabApplication'
}
// Opt-in: real durable campaign expansion, separate from the default regression suite.
tasks.register('campaignLoadTest', Test) {
description = 'Measure one isolated campaign DB handoff (default 100,000 targets)'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-load' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofHours(2)
systemProperty 'campaign.load.targets', providers.gradleProperty('campaignTargets').getOrElse('100000')
systemProperty 'campaign.load.output', layout.buildDirectory.dir('reports/campaign-load').get().asFile.absolutePath
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// Bounded end-to-end calibration before the larger delivery experiments.
tasks.register('campaignDeliveryPilot', Test) {
description = 'Calibrate campaign HTTP delivery and concurrent realtime probes (1,000..10,000 targets)'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(25)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '20m'
systemProperty 'campaign.delivery.targets', providers.gradleProperty('deliveryTargets').getOrElse('10000')
systemProperty 'campaign.delivery.publishBatchSize', providers.gradleProperty('publishBatchSize').getOrElse('1')
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// S8: one independent variable; fresh 10k dataset per invocation, unique raw output directory.
tasks.register('consumerScalingPilot', Test) {
description = 'Compare 1..3 campaign consumers with fixed realtime consumers and resource bounds'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(10)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '8m'
def consumers = providers.gradleProperty('campaignConsumers').getOrElse('1')
if (!(consumers in ['1', '2', '3'])) throw new GradleException('campaignConsumers must be 1, 2 or 3')
systemProperty 'campaign.delivery.consumerComparison', 'true'
systemProperty 'campaign.delivery.campaignConsumers', consumers
systemProperty 'campaign.delivery.targets', '10000'
systemProperty 'campaign.delivery.load', 'false'
systemProperty 'campaign.delivery.publishBatchSize', '1'
systemProperty 'campaign.delivery.transientQuotaRecovery', 'true'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// S8: fresh topics prepared before any app context; consumers/resources stay fixed.
tasks.register('partitionScalingPilot', Test) {
description = 'Compare 3 or 6 campaign request/retry partitions with three consumers and fixed recovery capacity'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(10)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '8m'
def partitions = providers.gradleProperty('campaignPartitions').getOrElse('3')
if (!(partitions in ['3', '6'])) throw new GradleException('campaignPartitions must be 3 or 6')
systemProperty 'campaign.delivery.partitionComparison', 'true'
systemProperty 'campaign.delivery.campaignPartitions', partitions
systemProperty 'campaign.delivery.targets', '10000'
systemProperty 'campaign.delivery.load', 'false'
systemProperty 'campaign.delivery.publishBatchSize', '1'
systemProperty 'campaign.delivery.transientQuotaRecovery', 'true'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// S8: campaign compression only; serial ACKs, linger zero and all delivery resources stay fixed.
tasks.register('compressionDeliveryPilot', Test) {
description = 'Compare none or LZ4 campaign producer compression through the bounded 10k HTTP delivery path'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(10)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '8m'
def compression = providers.gradleProperty('campaignCompression').getOrElse('none')
if (!(compression in ['none', 'lz4'])) throw new GradleException('campaignCompression must be none or lz4')
systemProperty 'campaign.delivery.compressionComparison', 'true'
systemProperty 'campaign.delivery.campaignCompression', compression
systemProperty 'campaign.delivery.targets', '10000'
systemProperty 'campaign.delivery.load', 'false'
systemProperty 'campaign.delivery.publishBatchSize', '1'
systemProperty 'campaign.delivery.transientQuotaRecovery', 'true'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// S8: change only the campaign Relay submission window; DB completion batch remains one.
tasks.register('relayWindowDeliveryPilot', Test) {
description = 'Compare one or ten outstanding campaign records through the bounded 10k HTTP delivery path'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(10)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '8m'
def window = providers.gradleProperty('campaignWindow').getOrElse('1')
if (!(window in ['1', '10'])) throw new GradleException('campaignWindow must be 1 or 10')
systemProperty 'campaign.delivery.windowComparison', 'true'
systemProperty 'campaign.delivery.campaignWindow', window
systemProperty 'campaign.delivery.targets', '10000'
systemProperty 'campaign.delivery.load', 'false'
systemProperty 'campaign.delivery.publishBatchSize', '1'
systemProperty 'campaign.delivery.transientQuotaRecovery', 'true'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// Broker-only producer experiment; no application DB or provider traffic.
tasks.register('producerBatchingPilot', Test) {
description = 'Compare serial ACKs, bounded ten-record submission and LZ4 on isolated Kafka topics'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'producer-batching-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(4)
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// Test-only bounded Relay scaling; application defaults and large-load tasks are unchanged.
tasks.register('relayScalingPilot', Test) {
description = 'Compare 1..3 campaign Relay loops at fixed Worker, DB pool and quota limits'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(25)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '20m'
systemProperty 'campaign.delivery.targets', providers.gradleProperty('deliveryTargets').getOrElse('10000')
systemProperty 'campaign.delivery.scaling', 'true'
systemProperty 'campaign.delivery.relayInstances', providers.gradleProperty('campaignRelays').getOrElse('1')
systemProperty 'campaign.delivery.publishBatchSize', '10'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// Observe JDBC/offset boundaries without changing application transaction or commit policies.
tasks.register('deliveryTimingPilot', Test) {
description = 'Profile JDBC acquisition/SQL/commit and Kafka commitSync in a bounded delivery pilot'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(25)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '20m'
systemProperty 'campaign.delivery.targets', providers.gradleProperty('deliveryTargets').getOrElse('10000')
systemProperty 'campaign.delivery.scaling', 'true'
systemProperty 'campaign.delivery.relayInstances', providers.gradleProperty('campaignRelays').getOrElse('1')
systemProperty 'campaign.delivery.publishBatchSize', '10'
systemProperty 'campaign.delivery.fineTiming', 'true'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
tasks.register('offsetCommitPilot', Test) {
description = 'Compare RECORD and COUNT_TIME at fixed Relay2/Worker3 with synchronous offset timing'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(25)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '20m'
systemProperty 'campaign.delivery.targets', providers.gradleProperty('deliveryTargets').getOrElse('10000')
systemProperty 'campaign.delivery.scaling', 'true'
systemProperty 'campaign.delivery.relayInstances', '2'
systemProperty 'campaign.delivery.publishBatchSize', '10'
systemProperty 'campaign.delivery.fineTiming', 'true'
systemProperty 'campaign.delivery.offsetComparison', 'true'
systemProperty 'campaign.delivery.offsetMode', providers.gradleProperty('offsetMode').getOrElse('RECORD')
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// Paired API admission timing, bounded to the existing 1k..10k pilot path.
tasks.register('apiAdmissionPilot', Test) {
description = 'Trace realtime HTTP admission, JDBC acquisition, SQL and commit in a small mixed pilot'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(25)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '20m'
systemProperty 'campaign.delivery.targets', providers.gradleProperty('deliveryTargets').getOrElse('10000')
systemProperty 'campaign.delivery.load', 'false'
systemProperty 'campaign.delivery.scaling', 'true'
systemProperty 'campaign.delivery.relayInstances', '2'
systemProperty 'campaign.delivery.publishBatchSize', '10'
systemProperty 'campaign.delivery.fineTiming', 'true'
systemProperty 'campaign.delivery.offsetComparison', 'true'
systemProperty 'campaign.delivery.offsetMode', providers.gradleProperty('offsetMode').getOrElse('RECORD')
systemProperty 'campaign.delivery.apiTiming', 'true'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
tasks.register('apiDbObservationPilot', Test) {
description = 'Bounded same-session DB observation during a 1k admission pilot; ON/OFF sampler control'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(25)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '20m'
systemProperty 'campaign.delivery.targets', '1000'
systemProperty 'campaign.delivery.load', 'false'
systemProperty 'campaign.delivery.scaling', 'true'
systemProperty 'campaign.delivery.relayInstances', '2'
systemProperty 'campaign.delivery.publishBatchSize', '10'
systemProperty 'campaign.delivery.fineTiming', 'true'
systemProperty 'campaign.delivery.offsetComparison', 'true'
systemProperty 'campaign.delivery.offsetMode', 'COUNT_TIME'
systemProperty 'campaign.delivery.apiTiming', 'true'
systemProperty 'campaign.delivery.dbObservation', 'true'
def sampler = providers.gradleProperty('dbObservation').getOrElse('ON')
if (!(sampler in ['ON', 'OFF'])) throw new GradleException('dbObservation must be ON or OFF')
systemProperty 'campaign.delivery.dbObserveEnabled', (sampler == 'ON').toString()
def minimumCallMillis = providers.gradleProperty('dbMinCallMillis').getOrElse('0')
if (!(minimumCallMillis in ['0', '20'])) throw new GradleException('dbMinCallMillis must be 0 or 20')
systemProperty 'campaign.delivery.dbMinCallMillis', minimumCallMillis
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
tasks.register('apiConnectionPilot', Test) {
description = 'Bounded 1k or 10k admission pilot with ON/OFF per-method auto-commit call timing'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(25)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '20m'
def targets = providers.gradleProperty('deliveryTargets').getOrElse('1000')
if (!(targets in ['1000', '10000'])) throw new GradleException('deliveryTargets must be 1000 or 10000 for apiConnectionPilot')
systemProperty 'campaign.delivery.targets', targets
systemProperty 'campaign.delivery.load', 'false'
systemProperty 'campaign.delivery.scaling', 'true'
systemProperty 'campaign.delivery.relayInstances', '2'
systemProperty 'campaign.delivery.publishBatchSize', '10'
systemProperty 'campaign.delivery.fineTiming', 'true'
systemProperty 'campaign.delivery.offsetComparison', 'true'
systemProperty 'campaign.delivery.offsetMode', 'COUNT_TIME'
systemProperty 'campaign.delivery.apiTiming', 'true'
systemProperty 'campaign.delivery.connectionPilot', 'true'
def details = providers.gradleProperty('connectionCalls').getOrElse('ON')
if (!(details in ['ON', 'OFF'])) throw new GradleException('connectionCalls must be ON or OFF')
systemProperty 'campaign.delivery.connectionCalls', (details == 'ON').toString()
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
tasks.register('apiFailurePilot', Test) {
description = 'Bounded 1k mixed Kafka delivery with opt-in first-failure capture and controlled failure modes'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'api-failure-pilot-controls' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(5)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '4m'
systemProperty 'campaign.delivery.targets', '1000'
systemProperty 'campaign.delivery.load', 'false'
systemProperty 'campaign.delivery.scaling', 'true'
systemProperty 'campaign.delivery.relayInstances', '2'
systemProperty 'campaign.delivery.publishBatchSize', '10'
systemProperty 'campaign.delivery.fineTiming', 'true'
systemProperty 'campaign.delivery.offsetComparison', 'true'
systemProperty 'campaign.delivery.offsetMode', 'COUNT_TIME'
systemProperty 'campaign.delivery.failureWindow', 'true'
def mode = providers.gradleProperty('failureMode').getOrElse('NONE')
if (!(mode in ['NONE', 'TIMEOUT', 'STORAGE_FAILURE'])) throw new GradleException('failureMode must be NONE, TIMEOUT or STORAGE_FAILURE')
systemProperty 'campaign.delivery.failureMode', mode
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// Same application settings as the million task, with only 1000 targets and bounded controls.
tasks.register('apiFailureLongRunRehearsal', Test) {
description = 'Rehearse long-run admission failure observation with only 1000 campaign targets'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'api-failure-pilot-controls' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(5)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '4m'
systemProperty 'campaign.delivery.targets', '1000'
systemProperty 'campaign.delivery.load', 'false'
systemProperty 'campaign.delivery.publishBatchSize', '1'
systemProperty 'campaign.delivery.failureWindow', 'true'
systemProperty 'campaign.delivery.failureProfile', 'REHEARSAL'
def mode = providers.gradleProperty('failureMode').getOrElse('NONE')
if (!(mode in ['NONE', 'TIMEOUT', 'STORAGE_FAILURE', 'REPORT_FAILURE'])) throw new GradleException('failureMode must be NONE, TIMEOUT, STORAGE_FAILURE or REPORT_FAILURE')
systemProperty 'campaign.delivery.failureMode', mode
def recovery = providers.gradleProperty('transientQuotaRecovery').getOrElse('OFF')
if (!(recovery in ['OFF', 'ON'])) throw new GradleException('transientQuotaRecovery must be OFF or ON')
systemProperty 'campaign.delivery.transientQuotaRecovery', (recovery == 'ON').toString()
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// Explicit 100k only; no million-target offset comparison is enabled.
tasks.register('offsetCommitLoad', Test) {
description = 'Compare RECORD/COUNT_TIME for exactly 100,000 HTTP campaign deliveries'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(90)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '80m'
systemProperty 'campaign.delivery.load', 'true'
systemProperty 'campaign.delivery.targets', '100000'
systemProperty 'campaign.delivery.scaling', 'true'
systemProperty 'campaign.delivery.relayInstances', '2'
systemProperty 'campaign.delivery.publishBatchSize', '10'
systemProperty 'campaign.delivery.fineTiming', 'true'
systemProperty 'campaign.delivery.offsetComparison', 'true'
systemProperty 'campaign.delivery.offsetMode', providers.gradleProperty('offsetMode').getOrElse('RECORD')
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// Explicit 100,000-target run. Reuses the pilot path without changing application defaults.
tasks.register('campaignDeliveryLoad', Test) {
description = 'Reconcile 100,000 HTTP campaign deliveries and concurrent realtime probes'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(90)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '80m'
systemProperty 'campaign.delivery.load', 'true'
systemProperty 'campaign.delivery.targets', '100000'
systemProperty 'campaign.delivery.publishBatchSize', providers.gradleProperty('publishBatchSize').getOrElse('1')
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// Long-running, opt-in only: never a dependency of test/check/build.
tasks.register('campaignDeliveryMillion', Test) {
description = 'Reconcile 1,000,000 HTTP deliveries (multi-hour experiment; not part of build)'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'campaign-delivery-pilot' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofHours(12)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '11h'
systemProperty 'campaign.delivery.load', 'true'
systemProperty 'campaign.delivery.targets', '1000000'
systemProperty 'campaign.delivery.publishBatchSize', providers.gradleProperty('publishBatchSize').getOrElse('1')
def observation = providers.gradleProperty('failureObservation').getOrElse('OFF')
if (!(observation in ['OFF', 'ON'])) throw new GradleException('failureObservation must be OFF or ON')
systemProperty 'campaign.delivery.failureWindow', (observation == 'ON').toString()
systemProperty 'campaign.delivery.failureProfile', 'LONG_RUN'
systemProperty 'campaign.delivery.failureMode', 'NONE'
def recovery = providers.gradleProperty('transientQuotaRecovery').getOrElse('OFF')
if (!(recovery in ['OFF', 'ON'])) throw new GradleException('transientQuotaRecovery must be OFF or ON')
systemProperty 'campaign.delivery.transientQuotaRecovery', (recovery == 'ON').toString()
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// SQL-only diagnosis: fixed 10k/100k datasets, no provider delivery or million-target rerun.
tasks.register('outboxQueryProbe', Test) {
description = 'Observe Outbox query plans and bounded DB contention at 10k/100k rows'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'outbox-query-probe' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(10)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '8m'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// Paired SQL-only experiment on an unchanged dataset; never runs as part of build.
tasks.register('outboxStatisticsProbe', Test) {
description = 'Compare Outbox plans and executed reads before and after ANALYZE TABLE'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'outbox-statistics-probe' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(10)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '8m'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
tasks.register('outboxLockProbe', Test) {
description = 'Observe default statistics, Outbox lock scope and bounded cross-lane waits'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'outbox-lock-probe', 'outbox-publish-probe' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(10)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '8m'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
// SQL-only calibration: one baseline, one held gap lock, one post-commit caller pause.
tasks.register('apiWaitProbe', Test) {
description = 'Distinguish admission row-lock waits from a synthetic delay after native commit returns'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'api-wait-probe' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(3)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '2m'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
tasks.register('apiSessionProbe', Test) {
description = 'Validate physical-session observation against the admission wait controls'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'api-wait-probe' }
systemProperty 'api.wait.observe', 'true'
def minimumCallMillis = providers.gradleProperty('dbMinCallMillis').getOrElse('0')
if (!(minimumCallMillis in ['0', '20'])) throw new GradleException('dbMinCallMillis must be 0 or 20')
systemProperty 'api.wait.dbMinCallMillis', minimumCallMillis
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(3)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '2m'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
tasks.register('apiConnectionProbe', Test) {
description = 'Calibrate auto-commit entry and restoration call timing against real transactional admissions'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'api-wait-probe' }
systemProperty 'api.wait.connectionCalls', 'true'
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(3)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '2m'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}
tasks.register('apiFailurePersistenceProbe', Test) {
description = 'Bounded real HTTP/MySQL timeout controls with immediate first-failure snapshot persistence'
group = 'verification'
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
useJUnitPlatform { includeTags 'api-failure-persistence' }
maxHeapSize = '512m'
maxParallelForks = 1
timeout = Duration.ofMinutes(4)
systemProperty 'junit.jupiter.execution.timeout.test.method.default', '3m'
outputs.upToDateWhen { false }
testLogging { events 'passed', 'skipped', 'failed'; showStandardStreams = true }
}