GINT providesautomatic running of testcases in parallel. This can significantly reduce run time for tests making it possible to run more tests more often. This performance advantage can introduce a level of complexity in test scripts. GINT provides capabilities to minimize and manage this potential complexity. GINT also supports simple serial running of testcases by a simple parameter setting. The performance benefits of parallel running vary greatly depending on the testing situation.
If your testcases are totally independent of each other, parallelism will not add any complexity! While this is good in principle and more easy to accomplish in unit testing, it is simply is not practical in many integration test scenarios. The key is to manage dependencies easily.
The following Parameters and Functions control parallelism for a test run:
The following Testcase parameters are involved in managing a parallel run environment:
There are differences in how parallelism works depending on whether a testcase is command or inline* based.
Each command testcase is run as a separate process with output managed by GINT. This output can be analysed for data (see Feature - automatic comparisons). Output for each testcase will be displayed contiguously in the log when the testcase is ended.
Each inline testcase is run in its own thread. Output to standard output will appear in the log at the time it is produced. Standard output data is not available to GINT for further analyses. Also, with threading, accesses to global information must be thread safe - this can be as simple as using synchronized qualifier on closures and functions. Use maxThread=1 if necessary.
If you suspect your test is failing because of parallelism, use -DmaxParallel=1 to run to verify. Normally, the problem will be do to testcase dependencies that are not defined. Use -Dverbose or -v on the command line to see more information on the running of the tests.