I'm trying to create a test that simulates a system failure to ensure the integrity of a Oracle Berkeley DB XML database. Data loss is currently being experienced during an insert operation so I'd like to setup a test that starts inserting an arbitrary number of documents and sack the process along the way (akin to someone yanking the power cord). After the process dies I want to spawn a new process and open the database to ensure it opens properly.
The unit test is one of many in a maven build and this test has to run in linux and windows XP environments. My current thought process is to hammer out a script for both operating systems since I can use the script to kill the process and start a new one in its place. Do I have any other options? Can I create a separate process space / VM using JUnit?
I wouldn't consider this kind of test a unit test but nevertheless you may be able to do something like this.
Please bear in mind previous comments on the non-deterministic nature of this test.
I have come across the SQLite team also doing a simulated failure strategy as part of their automated test suite.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With