What Is a Flow Test?
A flow test simulates a sequence of game events and verifies the outcome at each stage. For example:- Spawn an entity in the world
- Wait for ECS processors to initialize it
- Apply damage to trigger combat logic
- Wait for the entity to die
- Verify loot drops
waitTicks() and awaitCondition() to synchronize with the server’s tick loop.
@FlowTest
The@FlowTest annotation is a shorthand for @HytaleTest + @Tag("flow") with built-in world context and tick timeout:
| Parameter | Default | Description |
|---|---|---|
world | "" | World name (empty = test world) |
timeoutTicks | 200 | Max ticks before timeout (~6.7 seconds at 30 TPS) |
Why Tick Waiting Matters
Hytale’s game loop runs in discrete ticks. When you callctx.spawnEntity(), the entity is created but not fully set up yet. Components like health, stats, position, and effects are added by the game loop on the following ticks.
Without tick waiting:
Flow Test Structure
A well-structured flow test follows this pattern:Isolation for Flow Tests
Flow tests almost always mutate world state. UseIsolationStrategy.DEDICATED_WORLD:
Next Steps
Spawn-Kill-Loot Flow
A complete flow example: spawn, tier, kill, and verify loot drops.
Writing Custom Flows
How to structure your own multi-step flow tests.