[arquillian-issues] [JBoss JIRA] (ARQ-1345) maxTestClassesBeforeRestart causes more restarts than it should
Aslak Knutsen (JIRA)
jira-events at lists.jboss.org
Tue Jun 4 02:03:55 EDT 2013
[ https://issues.jboss.org/browse/ARQ-1345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aslak Knutsen closed ARQ-1345.
------------------------------
> maxTestClassesBeforeRestart causes more restarts than it should
> ---------------------------------------------------------------
>
> Key: ARQ-1345
> URL: https://issues.jboss.org/browse/ARQ-1345
> Project: Arquillian
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 1.0.3.Final
> Reporter: Rich DiCroce
> Assignee: Aslak Knutsen
> Fix For: 1.0.4.Final
>
>
> ContainerRestarter (package org.jboss.arquillian.container.test.impl.client.container) has a bug in it that causes maxTestClassesBeforeRestart to be evaluated slightly incorrectly. The below code is what the shouldRestart() method currently does:
> {code}
> ArquillianDescriptor descriptor = configuration.get();
> Integer maxTestClasses = descriptor.engine().getMaxTestClassesBeforeRestart();
> if(maxTestClasses == null)
> {
> return false;
> }
> if(maxTestClasses > -1)
> {
> if((maxTestClasses -1 ) == testClassesCount)
> {
> testClassesCount = 0;
> return true;
> }
> }
> testClassesCount++;
> return false;
> {code}
> Because it checks if maxTestClasses - 1 is equal to testClassesCount, the first container restart actually occurs before test #N-1, not test #N. An easy way to see this is to set maxTestClassesBeforeRestart to 1; you will observe that the container is started for the first time, then immediately shut down without anything being deployed, then restarted.
> This can be fixed by checking if maxTestClasses == testClassesCount instead of maxTestClasses - 1 == testClassesCount.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the arquillian-issues
mailing list