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

Bartosz Majsak bartosz at redhat.com
Wed Feb 15 07:38:27 EST 2017


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

```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/AbstractAlgeronPublisherCommand.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