When tests run inside a live server, they share state with the production environment. Isolation strategies control how much of that shared state is protected from test mutations. Choosing the right strategy is critical for test reliability and server safety.Documentation Index
Fetch the complete documentation index at: https://docs.hrtk.frotty27.com/llms.txt
Use this file to discover all available pages before exploring further.
The Three Strategies
| Strategy | Protects | Cost | Best For |
|---|---|---|---|
NONE | Nothing | Zero overhead | Read-only tests, pure logic, assertions |
SNAPSHOT | Created entities | Track + cleanup per suite | Entity creation tests |
DEDICATED_WORLD | Full world state | World create + destroy per suite | Block, spawn, and integration tests |
Decision Flowchart
Side-by-Side Comparison
NONE
No protection. Tests see and modify live server state. Suite instantiation is the only boundary. Fast but risky for mutating tests.
SNAPSHOT
Entities created during the suite are tracked and removed after. Only cleans up created entities - modifications to pre-existing entities and blocks are NOT reverted.
DEDICATED_WORLD
A temporary void world is created for the suite. All entities, blocks, and state are destroyed when the suite completes. Full isolation at the cost of world creation overhead.
Usage
Set the isolation strategy on@HytaleSuite:
When to Use Each
NONE: Read-only and logic tests
NONE: Read-only and logic tests
Use
NONE when your tests:- Only read data, never write
- Test pure functions or utility classes
- Test codec round-trips (no server state involved)
- Verify annotations, configuration, or metadata
SNAPSHOT: Entity creation tests
SNAPSHOT: Entity creation tests
Use
SNAPSHOT when your tests:- Create entities and need them cleaned up automatically
- Attach components to newly created entities
- Need created entities removed after the suite without destroying the world
DEDICATED_WORLD: Block and spawn tests
DEDICATED_WORLD: Block and spawn tests
Use
DEDICATED_WORLD when your tests:- Place or break blocks
- Spawn and kill entities
- Need a clean, predictable world state
- Test multi-step flows (spawn -> modify -> verify -> cleanup)
Next Steps
- Isolation: NONE - detailed guide
- Isolation: SNAPSHOT - detailed guide
- Isolation: DEDICATED_WORLD - detailed guide