Skip to content

Commit 1e9c505

Browse files
committed
Avoid dumping the heap in Painless tests (elastic#44782)
Well, we have a test here that intentionally causes an OutOfMemoryError, to ensure that Painless handles it (I still strongly disagree with doing this). This causes two things to happen: an OutOfMemoryError to be dumped to the console, and the heap to be dumped to disk. This makes it look like we had an OutOfMemoryError while running tests, and the tests did not fail properly. This commit changes the tests configuration so that we suppress the heap dump, which also causes the OutOfMemoryError to no longer be dumped to the console.
1 parent 4c77d5e commit 1e9c505

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/lang-painless/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ dependencyLicenses {
4141
}
4242

4343
test {
44-
jvmArgs '-XX:-OmitStackTraceInFastThrow'
44+
// in WhenThingsGoWrongTests we intentionally generate an out of memory error, this prevents the heap from being dumped to disk
45+
jvmArgs '-XX:-OmitStackTraceInFastThrow', '-XX:-HeapDumpOnOutOfMemoryError'
4546
}
4647

4748
/* Build Javadoc for the Java classes in Painless's public API that are in the

0 commit comments

Comments
 (0)