Skip to content

Bug: Heap error is swallowed in Spock 2, feature is skipped, subsequent features don't run #1294

@treyturner

Description

@treyturner

Issue description

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.

How to reproduce

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/JDK

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)

Groovy version

3.0.6 and 3.0.7 - affected
2.5.14 - unaffected

Gradle

Gradle 6.7

Operating System

Windows 10 1909 (18363.1316)

IDE

IntelliJ IDEA Community Edition 2020.3.2

Build-tool dependencies used

implementation "org.apache.poi:poi:5.0.0"
implementation "org.apache.poi:poi-ooxml:5.0.0"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions