Forum Discussion

Mblanch's avatar
Mblanch
New Member
3 years ago

Running Test Cases in Parallel

i am attempting to run a lot of testcases in parallel. i start out fine but i wonder if there is a maximum number ( i have 500)  that should be set at a time . i see alot of the test cases executing and passing and some are failing because of set assertions but then the process seems to just stop . i check Task Manager and see memory runs around 80 %.  i did increase the MAXHEAP value in the VMoptions file from 40 to 90 (as indicated with a popup message i received during execution)

i wonder if i need to reduce the Test cases to 200 at a time and make separate test suites, or if there is a place i can make changes or limits to special values

 

Regards, 

Martin 

  • nmrao's avatar
    nmrao
    Champion Level 3

    The machine may not handle so many threads when the out-of-the-box parallel execution mode.

    However, it is possible to write a groovy script which can execute the given number of tests in parallel unlike the above.

    • richie's avatar
      richie
      Community Hero
      Hey Mblanch,

      I think if you have like 500 tests in the same testsuite it'll use more resource than if you have those 500 tests spread over multiple testsuites....thats a guess on my part using logic, but i think im right

      Ta

      Rich
  • nmrao's avatar
    nmrao
    Champion Level 3

    Mblanch 

    Here is some sample groovy script where you create the list of test cases and set the number of threads (which you machine can handle)

    https://stackoverflow.com/questions/7921473/how-to-execute-a-pool-of-tasks-using-set-number-of-java-groovy-threads-without

    NOTE: in the answers, it was mentioned the tasks; this is nothing but your test case list.

     

    If you are using this groovy script in a separate test case, then you need few more lines of groovy code to read the actual test suite where you have bunch of tests and build the list and pass that list in place of tasks. Also ensure the test suite is disabled so that they won run again.

    Keep the execution mode to sequencial only. May be it would best in the command line execute. Of course, tool should work as well.

     

    You ma start with 4 threads and keep increasing and come up with best value for your machine and tests.