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.
IsolationStrategy.DEDICATED_WORLD creates a temporary void world for your suite, runs all tests inside it, and destroys it when the suite finishes. This provides the strongest isolation - nothing from your tests can affect the live server’s worlds.
When to Use
- Tests that place or break blocks
- Tests that spawn entities and need a clean environment
- Integration tests and flow tests (spawn -> combat -> loot)
- Any test that needs a predictable, empty world
How It Works
Before Suite
HRTK calls
TestWorldManager.getOrCreateTestWorld(suiteId) to create a void world. The world has no terrain, no entities, and no blocks - a blank canvas.Test Execution
Your
@WorldTest and @FlowTest methods receive a WorldTestContext bound to the temporary world. You can spawn entities, place blocks, and modify state freely.Usage
Entity Spawning in Dedicated Worlds
Dedicated worlds are the safest place to spawn test entities. They will not collide with existing live-world entities, and cleanup is automatic.Fallback Behavior
If HRTK cannot create a dedicated world (e.g., due to server configuration or resource limits), it logs a warning and falls back to running against live state:Performance
Creating and destroying a world has significant overhead compared toNONE or SNAPSHOT. This cost is paid once per suite, not per test. For suites with many tests, the per-test amortized cost is small.
| Operation | Typical Cost |
|---|---|
| World creation | 50-200ms |
| World destruction | 10-50ms |
| Per-test execution | Same as NONE |
Complete Example
Next Steps
- Isolation: NONE - no protection, fastest
- Isolation: SNAPSHOT - entity-only rollback
- Flow Tests - multi-step tests in dedicated worlds