Child pages
  • Thrash Testing
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

One can test EOF operations in concurrent threads using the "thrash" test built into Wonder. One uses ant to execute the tests.

See ERXThrashTest.java in the Wonder sources. One can define inner classes in that class. The "SimpleFetchTest" and "SimpleInsertTest" classes are examples. The thrash test will take a "scheme" that can be specified by the user and execute that scheme.

scheme:SimpleInsertTest::0-5,5-10,15-10,20-10

For example, the scheme above will create threads using the "SimpleInsertTest" inner class. There is a string parameter that can be defined after the inner class name, which in this case is "". The ERXThrashTest class will create 5 threads and pass them a "delay" parameter of 0. Then it will create 10 threads and pass them a "delay" parameter of 5. This will cause the thread to start and then sleep for 5 seconds. The scheme above creates a total of 35 threads. There will be 5 that start immediately, 10 that start after 5 seconds, 10 more that start after 15 seconds, and 10 more that start after 20 seconds. The scheme can be arbitrarily long. The inner class can be defined to do some interesting set of operations, whatever is desired.

There is a target defined in ant which will run a pre-defined set of schemes.

This set of commands will compile the tests (the ERXThrashTest class compilation is conditional on having "include.tests=true" defined in the ant build of the ERExtensions project) and run the thrash tests:

cd Wonder
ant tests.all thrash.all

This command will run the same scheme as above, but with 10 times the number of threads.

ant thrash -Dthrash.scheme=scheme:SimpleInsertTest::0-50,5-100,15-100,20-100
  • No labels