@@ -249,12 +249,12 @@ class JvmLiveObjectGrowthDetectorTest {
249
249
}
250
250
251
251
@Test
252
- fun `DeleteOnObjectsNotGrowing does invokes file deletion in between each scenario` () {
252
+ fun `KeepHeapDumpsOnObjectsGrowing does invokes file deletion in between each scenario` () {
253
253
var didDeleteFile = false
254
254
val heapDumpDirectory = tempFolder.newFolder()
255
255
val detector = HeapDiff .repeatingJvmInProcessScenario(
256
256
objectGrowthDetector = ObjectGrowthDetector .forJvmHeapNoSyntheticRefs(),
257
- heapDumpDeletionStrategy = HeapDumpDeletionStrategy .DeleteOnObjectsNotGrowing {
257
+ heapDumpDeletionStrategy = HeapDumpDeletionStrategy .KeepHeapDumpsOnObjectsGrowing {
258
258
didDeleteFile = true
259
259
it.delete()
260
260
},
@@ -271,12 +271,12 @@ class JvmLiveObjectGrowthDetectorTest {
271
271
}
272
272
273
273
@Test
274
- fun `DeleteOnObjectsNotGrowing does not delete any heap dump if objects growing` () {
274
+ fun `KeepHeapDumpsOnObjectsGrowing does not delete any heap dump if objects growing` () {
275
275
val maxHeapDump = 5
276
276
val heapDumpDirectory = tempFolder.newFolder()
277
277
val detector = HeapDiff .repeatingJvmInProcessScenario(
278
278
objectGrowthDetector = ObjectGrowthDetector .forJvmHeapNoSyntheticRefs(),
279
- heapDumpDeletionStrategy = HeapDumpDeletionStrategy .DeleteOnObjectsNotGrowing (),
279
+ heapDumpDeletionStrategy = HeapDumpDeletionStrategy .KeepHeapDumpsOnObjectsGrowing (),
280
280
heapDumpDirectoryProvider = { heapDumpDirectory }
281
281
)
282
282
@@ -292,12 +292,12 @@ class JvmLiveObjectGrowthDetectorTest {
292
292
}
293
293
294
294
@Test
295
- fun `DeleteOnObjectsNotGrowing invokes file deletion on completion if objects not growing` () {
295
+ fun `KeepHeapDumpsOnObjectsGrowing invokes file deletion on completion if objects not growing` () {
296
296
var filesDeleted = 0
297
297
val heapDumpDirectory = tempFolder.newFolder()
298
298
val detector = HeapDiff .repeatingJvmInProcessScenario(
299
299
objectGrowthDetector = ObjectGrowthDetector .forJvmHeapNoSyntheticRefs(),
300
- heapDumpDeletionStrategy = HeapDumpDeletionStrategy .DeleteOnObjectsNotGrowing {
300
+ heapDumpDeletionStrategy = HeapDumpDeletionStrategy .KeepHeapDumpsOnObjectsGrowing {
301
301
filesDeleted++
302
302
it.delete()
303
303
},
@@ -321,12 +321,12 @@ class JvmLiveObjectGrowthDetectorTest {
321
321
}
322
322
323
323
@Test
324
- fun `ZipAndDeleteOnObjectsNotGrowing leaves zipped heap dumps if objects growing` () {
324
+ fun `KeepZippedHeapDumpsOnObjectsGrowing leaves zipped heap dumps if objects growing` () {
325
325
val maxHeapDump = 5
326
326
val heapDumpDirectory = tempFolder.newFolder()
327
327
val detector = HeapDiff .repeatingJvmInProcessScenario(
328
328
objectGrowthDetector = ObjectGrowthDetector .forJvmHeapNoSyntheticRefs(),
329
- heapDumpDeletionStrategy = HeapDumpDeletionStrategy .ZipAndDeleteOnObjectsNotGrowing (),
329
+ heapDumpDeletionStrategy = HeapDumpDeletionStrategy .KeepZippedHeapDumpsOnObjectsGrowing (),
330
330
heapDumpDirectoryProvider = { heapDumpDirectory }
331
331
)
332
332
@@ -343,11 +343,11 @@ class JvmLiveObjectGrowthDetectorTest {
343
343
}
344
344
345
345
@Test
346
- fun `ZipAndDeleteOnObjectsNotGrowing deletes all files if objects not growing` () {
346
+ fun `KeepZippedHeapDumpsOnObjectsGrowing deletes all files if objects not growing` () {
347
347
val heapDumpDirectory = tempFolder.newFolder()
348
348
val detector = HeapDiff .repeatingJvmInProcessScenario(
349
349
objectGrowthDetector = ObjectGrowthDetector .forJvmHeapNoSyntheticRefs(),
350
- heapDumpDeletionStrategy = HeapDumpDeletionStrategy .ZipAndDeleteOnObjectsNotGrowing (),
350
+ heapDumpDeletionStrategy = HeapDumpDeletionStrategy .KeepZippedHeapDumpsOnObjectsGrowing (),
351
351
heapDumpDirectoryProvider = { heapDumpDirectory }
352
352
)
353
353
val leakyScenarioRuns = 3
@@ -366,35 +366,6 @@ class JvmLiveObjectGrowthDetectorTest {
366
366
assertThat(heapDumpDirectory.listFiles()).isEmpty()
367
367
}
368
368
369
- @Test
370
- fun `ZipAndDeleteOnObjectsNotGrowing zips heap dumps in between each scenario` () {
371
- val heapDumpDirectory = tempFolder.newFolder()
372
- val maxHeapDump = 5
373
-
374
- val detector = HeapDiff .repeatingJvmInProcessScenario(
375
- objectGrowthDetector = ObjectGrowthDetector .forJvmHeapNoSyntheticRefs(),
376
- heapDumpDeletionStrategy = HeapDumpDeletionStrategy .ZipAndDeleteOnObjectsNotGrowing (),
377
- heapDumpDirectoryProvider = { heapDumpDirectory }
378
- )
379
- var i = 1
380
- detector.findRepeatedlyGrowingObjects(
381
- maxHeapDumps = maxHeapDump,
382
- scenarioLoopsPerDump = 1
383
- ) {
384
- val heapDumpDirectoryFileExtensions = heapDumpDirectory.listFiles()!! .map { it.extension }
385
- assertThat(heapDumpDirectoryFileExtensions).hasSize(i - 1 )
386
- if (i > 1 ) {
387
- assertThat(heapDumpDirectoryFileExtensions).containsOnly(" zip" )
388
- }
389
- leakies + = Any ()
390
- i++
391
- }
392
-
393
- val heapDumpDirectoryFileExtensions = heapDumpDirectory.listFiles()!! .map { it.extension }
394
- assertThat(heapDumpDirectoryFileExtensions).hasSize(maxHeapDump)
395
- assertThat(heapDumpDirectoryFileExtensions).containsOnly(" zip" )
396
- }
397
-
398
369
private fun ObjectGrowthDetector.Companion.forJvmHeapNoSyntheticRefs (): ObjectGrowthDetector {
399
370
val referenceMatchers = JvmObjectGrowthReferenceMatchers .defaults
400
371
return ObjectGrowthDetector (
0 commit comments