[forge-dev] Issues with shell tests in Arquillian Addon

Bartosz Majsak bartosz at redhat.com
Wed Feb 15 07:40:34 EST 2017


*Ignore previous mail, here’s reformatted one.*

Hi,
in Forge Arquillian Addon we are struggling with integration tests executed
using org.jboss.forge.addon.shell.test.ShellTest. We’ve noticed that
particular tests are “randomly” failing every n-th execution. Interestingly
enough it’s almost always AddArquillianAlgeronPublisherTest
<https://github.com/forge/addon-arquillian/blob/e6b6e905ec86ceef1c1a72862ded27e680039f71/src/test/java/test/integration/algeron/AddArquillianAlgeronPublisherTest.java>
hanging on 2nd or 3rd command. Not sure what makes it so special, but at
least it’s a starting point for further investigation. Without a serious
scientific method I can conclude it’s almost 5/10 runs of the full build.

We spent some time investigating without that much of luck, but what we
have observed is that

public boolean isEnabled(UIContext context) {
    Boolean parent = super.isEnabled(context);
    if (parent) {
        return getSelectedProject(context).hasFacet(AlgeronConsumer.class);
    }
    return parent;
}

is sometimes not recognizing that parent is a project. This might a be
lead. Above snippet comes from AbstractAlgeronPublisherCommand
<https://github.com/forge/addon-arquillian/blob/e6b6e905ec86ceef1c1a72862ded27e680039f71/src/main/java/org/jboss/forge/arquillian/command/algeron/AbstractAlgeronPublisherCommand.java#L64>
.

Moreover we are explictly installing all the required facets, as we thought
that could be the root cause.

@Beforepublic void setUp() throws Exception {
    final AddonRegistry addonRegistry =
Furnace.instance(getClass().getClassLoader()).getAddonRegistry();
    projectFactory = addonRegistry.getServices(ProjectFactory.class).get();
    shellTest = addonRegistry.getServices(ShellTest.class).get();
    project = projectFactory.createTempProject(asList(JavaSourceFacet.class,
ArquillianFacet.class, AlgeronProvider.class, AlgeronConsumer.class,
AlgeronPublisherFacet.class));
    shellTest.getShell().setCurrentResource(project.getRoot());
}

But it seems it’s not the problem. Or maybe we are doing something wrong
here as well?

Any hints would be more than welcome :) This is really bothering us at the
moment :\

Cheers,
Bartosz.

On Wed, Feb 15, 2017 at 1:38 PM, Bartosz Majsak <bartosz at redhat.com> wrote:

Hi,
>
> in Forge Arquillian Addon we are struggling with integration tests
> executed using `org.jboss.forge.addon.shell.test.ShellTest`. We've
> noticed that particular tests are "randomly" failing every n-th execution.
> Interestingly enough it’s almost always [`AddArquillianAlgeronPublisherT
> est`](https://github.com/forge/addon-arquillian/blob/
> e6b6e905ec86ceef1c1a72862ded27e680039f71/src/test/java/test/
> integration/algeron/AddArquillianAlgeronPublisherTest.java) hanging on
> 2nd or 3rd command. Not sure what makes it so special, but at least it's a
> starting point for further investigation. Without a serious scientific
> method I can conclude it's almost 5/10 runs of the full build.
>
> We spent some time investigating without that much of luck, but what we
> have observed is that
>
> ```java
> public boolean isEnabled(UIContext context) {
>     Boolean parent = super.isEnabled(context);
>     if (parent) {
>         return getSelectedProject(context).hasFacet(AlgeronConsumer.
> class);
>     }
>     return parent;
> }
> ```
> is sometimes not recognizing that `parent` is a project. This might a be
> lead. Above snippet comes from [`AbstractAlgeronPublisherCommand`](
> https://github.com/forge/addon-arquillian/blob/
> e6b6e905ec86ceef1c1a72862ded27e680039f71/src/main/java/org/
> jboss/forge/arquillian/command/algeron/AbstractAlgeronPublisherComman
> d.java#L64).
>
> Moreover we are explictly installing all the required facets, as we
> thought that could be the root cause.
>
>
> But it seems it's not the problem. Or maybe we are doing something wrong
> here as well?
>
> Any hints would be more than welcome :) This is really bothering us at the
> moment :\
>
> Cheers,
> Bartosz.
>
>


More information about the forge-dev mailing list