CoreNetwork / TradeCraft

Custom villager tiers, trades and rebalancing. [No longer updated]
MIT License
2 stars 6 forks source link

Test how the plugin handles edge cases #15

Closed riddle closed 10 years ago

riddle commented 10 years ago
  1. Server stop (without save)
  2. Crash (with code which will topple over Java like OutOfMemory exception)
  3. Hard stop (kill java)
riddle commented 10 years ago

It would probably be useful to trigger trade events continuously so when you kill the process it would be akin to a player doing it during crash.

matejdro commented 10 years ago

Server save is completely irrelevant here as I don't save anything into vanilla villagers. Possible issue is that villager entity itself might not get saved to the world but this is out of Tradecraft scope.

Testing by killing java is very tricky because all those actions (saving to db etc.) take very little time (<1ms usually) which means it is hard to crash at precise spot to make it break.

Also read my answer at #16

riddle commented 10 years ago

Hmm right.

But what would happen if you read some stuff from db which wouldn't fit in how config sees trades? Or some other garbled junk?

matejdro commented 10 years ago

Config is only used to fill DB. Data for trades is then only read from DB. Worst case scenario are errors because of nonexisting IDs.

riddle commented 10 years ago

OK, maybe in a case of nonexisting IDs it would fail gracefully and just wipe all trades and create new ones while notifying console? But that can be done later.