A Spock feature that throws an java.lang.OutOfMemoryError: Java heap space exception will have its exception apparently swallowed by Spock 2.0 (I tried both M2 and M4). The offending feature will be returned as skipped, and no subsequent features in the specification are executed.
By comparison, Spock 1.3 will throw the heap error, fail the offending feature, and still execute subsequent features, which are all more desireable behaviors.
I am happy to explain this or the MRE linked below further if/as needed.
Here is a minimal reproducible example in the form of a Gradle project, which has subprojects for Spock 1.3 and Spock 2.0 so you can easily see the difference:
https://github.com/treyturner/spock-2-silent-heap-error-skips-tests
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
3.0.6 and 3.0.7 - affected
2.5.14 - unaffected
Gradle 6.7
Windows 10 1909 (18363.1316)
IntelliJ IDEA Community Edition 2020.3.2
implementation "org.apache.poi:poi:5.0.0"
implementation "org.apache.poi:poi-ooxml:5.0.0"
Thanks @treyturner, btw the MCVE was just
class OomSpec extends Specification {
def a() {
expect:
throw new OutOfMemoryError()
}
}
but thanks for providing that example project.
Most helpful comment
Thanks @treyturner, btw the MCVE was just
but thanks for providing that example project.