openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.7k forks source link

Enocean binding tests do not support concurrent test execution #3895

Open dvanherbergen opened 8 years ago

dvanherbergen commented 8 years ago

To improve performance of the automated builds, I tried building using multiple concurrent threads: mvn -T 2 clean install. During these build, the enocean tests occasionally failed.

org.openhab.binding.enocean.internal.bus.RockerSwitchInDimmerOnOffProfileTest.lightenUpDuringVeryLongButtonPressDown

Update State expected:<INCREASE> but was:<null>
Stacktrace

java.lang.AssertionError: Update State expected:<INCREASE> but was:<null>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:743)
    at org.junit.Assert.assertEquals(Assert.java:118)
    at org.openhab.binding.enocean.internal.bus.RockerSwitchInDimmerOnOffProfileTest.lightenUpDuringVeryLongButtonPressDown(RockerSwitchInDimmerOnOffProfileTest.java:90)
org.openhab.binding.enocean.internal.bus.RockerSwitchInDimmerOnOffProfileTest.dimmLightDuringLongButtonPressUp

Update State expected:<DECREASE> but was:<null>
Stacktrace

java.lang.AssertionError: Update State expected:<DECREASE> but was:<null>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:743)
    at org.junit.Assert.assertEquals(Assert.java:118)
    at org.openhab.binding.enocean.internal.bus.RockerSwitchInDimmerOnOffProfileTest.dimmLightDuringLongButtonPressUp(RockerSwitchInDimmerOnOffProfileTest.java:104)

Failure was not consistent and not reproducable on a fast machine.

The tests should be updated so that they can be executed in parallel.

martinvw commented 7 years ago

I see this test failing frequently on the cloudbees buildserver too, don't know if it uses multiple concurrent threads.