mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-26 22:10:18 +00:00
Fail-closed modded decoration
- A generator with a refused or stopping engine refuses imported feature settings - Those settings no longer fall back to vanilla ones - Decoration fails when a sealed runtime has no settled feature table - Decoration fails when the feature table was retired before placement - Stacked initial spawns fail when the surface spawn biome lookup is rejected - Those spawns no longer fall back to the chunk's top biome - Bind failures from a stopping runtime stay out of the refusal memo and banner - The next bind after such a failure retries
This commit is contained in:
1 parent
0cb3417755
commit
96a400b585
8 files changed
+258
-51
No files matched your search
@@ -4,6 +4,7 @@ import art.arcane.iris.world.history.SavedBiomeUnavailableException;
|
||||
import art.arcane.volmlib.util.mantle.MantleClosedException;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.channels.ClosedByInterruptException;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
@@ -52,6 +53,33 @@ public class GenerationFailuresTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shutdownFailuresAreTheLifecycleSubsetOfEngineFailures() {
|
||||
assertTrue(GenerationFailures.isShutdownFailure(new GenerationClosedException("router closed")));
|
||||
assertTrue(GenerationFailures.isShutdownFailure(new MantleClosedException("Tectonic Plate is closed!")));
|
||||
assertTrue(GenerationFailures.isShutdownFailure(new RejectedExecutionException("pool shut down")));
|
||||
assertTrue(GenerationFailures.isShutdownFailure(new ClosedByInterruptException()));
|
||||
assertTrue(GenerationFailures.isShutdownFailure(new GenerationSessionException("sealed", true)));
|
||||
assertTrue(GenerationFailures.isShutdownFailure(new IllegalStateException("bind failed",
|
||||
new CompletionException(new InterruptedException()))));
|
||||
|
||||
assertFalse(GenerationFailures.isShutdownFailure(new OutOfMemoryError()));
|
||||
assertFalse(GenerationFailures.isShutdownFailure(new NoClassDefFoundError("art/arcane/Missing")));
|
||||
assertFalse(GenerationFailures.isShutdownFailure(new GenerationSessionException("wrong engine")));
|
||||
assertFalse(GenerationFailures.isShutdownFailure(new IllegalStateException(
|
||||
"Iris generation history is unusable", new IOException("registry definition changed"))));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void anyFailureOnAnInterruptedThreadIsAShutdownFailure() {
|
||||
Thread.currentThread().interrupt();
|
||||
try {
|
||||
assertTrue(GenerationFailures.isShutdownFailure(new IllegalStateException("history unusable")));
|
||||
} finally {
|
||||
Thread.interrupted();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void rethrowPropagatesEngineFailuresAndReturnsForContentFailures() {
|
||||
GenerationClosedException closed = new GenerationClosedException("router closed");
|
||||
|
||||
Reference in new issue
Block a user