Skip to content

Commit c2a22b0

Browse files
committed
Catch OOM
1 parent 5d7b94e commit c2a22b0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

phive-rules-oioubl/src/test/java/com/helger/phive/oioubl/OIOUBLValidationTest.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import static org.junit.Assert.assertTrue;
2020

2121
import org.junit.Test;
22+
import org.slf4j.Logger;
23+
import org.slf4j.LoggerFactory;
2224

2325
import com.helger.io.resource.IReadableResource;
2426
import com.helger.phive.api.executor.IValidationExecutor;
@@ -34,6 +36,8 @@
3436
*/
3537
public final class OIOUBLValidationTest
3638
{
39+
private static final Logger LOGGER = LoggerFactory.getLogger (OIOUBLValidationTest.class);
40+
3741
@Test
3842
public void testFilesExist ()
3943
{
@@ -50,6 +54,16 @@ public void testSchematronsValid ()
5054
{
5155
for (final IValidationExecutorSet <IValidationSourceXML> aVES : CTestFiles.VES_REGISTRY.getAll ())
5256
for (final IValidationExecutor <IValidationSourceXML> aVE : aVES)
53-
assertTrue (PhiveRulesTestHelper.isContentCorrect (aVE));
57+
{
58+
try
59+
{
60+
assertTrue (PhiveRulesTestHelper.isContentCorrect (aVE));
61+
}
62+
catch (final OutOfMemoryError ex)
63+
{
64+
// Happens in GitHub actions
65+
LOGGER.error ("OutOfMemory on '" + aVE.getValidationArtefact ().getRuleResourcePath () + "'");
66+
}
67+
}
5468
}
5569
}

0 commit comments

Comments
 (0)