The same tests are running in each batch

176 views
Skip to first unread message

Oleksandr Chernookov

unread,
Feb 21, 2017, 6:44:39 AM2/21/17
to Serenity BDD Users Group
Hello,
I'm using Serenity with Junit and want to run tests in parallel batches, so I've configured job in Jenkins base on the article http://serenity-bdd.info/docs/serenity/#_configuration_parallel_executing_with_jenkins.
I use the same number from article 
serenity.batch.count=3
serenity.batch.number=${BATCH_NUMBER}

When I run job I see 3 batches are started (1,2 and 3) , I've opened console for each butch and see that test1 from Class1 is running in batch 1, batch 2 and batch 3 at the same time.
 
There is serenity.property file:
webdriver.driver=firefox
webdriver.wait.for.timeout=2000
serenity.timeout=30000
webdriver.base.url = http://localhost:8080/login
serenity.take.screenshots=BEFORE_AND_AFTER_EACH_STEP
serenity.resized.image.width=2400
firefox.preferences=browser.startup.homepage_override.mstone=ignore; startup.homepage_welcome_url.additional=about:blank
serenity.batch.strategy=DIVIDE_BY_TEST_COUNT
serenity.batch.size=3
serenity.batch.count=3

Is someone knows how to resolve this problem ?

Strugariu Florin

unread,
Feb 21, 2017, 2:09:08 PM2/21/17
to Serenity BDD Users Group
I had the same issues

Here is a similar thread: https://groups.google.com/forum/#!topic/thucydides-users/niNNRVHGTAQ

I ended up using the maven-surefire-plugin with:

<parallel>classes</parallel>
<threadCount>${testThreadCount}</threadCount>

Oleksandr Chernookov

unread,
Feb 22, 2017, 7:15:29 AM2/22/17
to Serenity BDD Users Group
Thanks for hint. I've found in pom file 
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<parallel>classes</parallel>
<threadCount>5</threadCount>
</configuration>
</plugin>
I removed this plugin  and tests start running in batches as it should be. 
Reply all
Reply to author
Forward
0 new messages