openbase / bco.device

Other
0 stars 0 forks source link

Random test failures #18

Closed TimoMichi closed 7 years ago

TimoMichi commented 7 years ago

Testcases fail from time to time. (Even Travis seems to have this issue) Errors occur at different testcases quite random(unitremote tests, agent tests, location remote test..)

Origin of this problem might be the shutdown of MockRegistry or timing issues.

DivineThreepwood commented 7 years ago

Maybe related to openbase/jul#18

pLeminoq commented 7 years ago

One issue is that when you directly update the state of a provider by calling the update method on a controller instance, e.g. lightSensorController.updateIlluminanceStateProvider(...), you cannot be sure that afterwards the change is already published to the remote. Even a requestData does not guarantee that. This could cause the new illuminanceState test for the location remote to fail.

TimoMichi commented 7 years ago

Example for a test failure:

java.lang.AssertionError: Power state has not been set in time or the return value from the getter is different! expected: but was:
    at org.openbase.bco.manager.device.test.remote.unit.UnitGroupRemoteTest.testGetPowerState(UnitGroupRemoteTest.java:195)
DivineThreepwood commented 7 years ago

Solved?

pLeminoq commented 7 years ago

Fixed a bug in the AbsenceEnergySavingAgent which caused its test to fail. Initially the location published an unkown value for its presence state which caused the AbsenceEnergySavingAgent to turn off the light. Because the test turned the lights on around the same time when this update arrived these two interfered and if you were lucky the light had the correct value afterwards. As a fix the Agent now ignores unknown values for the presence state

pLeminoq commented 7 years ago

Should have improved a lot by the recent updates like the UnitStateAwaiter and new test structure. Fixing openbase/bco.registry#37 still remains.

DivineThreepwood commented 7 years ago

Moved to priorized because bugs seems to be independent from issue openbase/bco.registry#37 because its fixed and the random failures still exist.

DivineThreepwood commented 7 years ago

Please reenable #40 is this issue is solved.

pLeminoq commented 7 years ago

openbase/jul@543e528bcb1f1990aa712885395154157cb6c5bb fixed a bug where agent remotes waitForData would return before the localServer has been started and thus the following method call would not return.

DivineThreepwood commented 7 years ago

Seems to me fixed, otherwise reopen.