(fwServicesTest): random fail in AppConfigTest: refactor AppConfigManager
Summary
Because of the macro WAIT (), sometimes the timer is not long enough and the appConfig has not had time to process the signals. We've increased the wait from 1 to 10ms recently so that it works now on Julien's computer, but it's totally arbitrary. It would need something more robust.
The test startStopTest
has been disabled because it fails randomly.
Steps to reproduce
Launch multiple times the test on a busy computer.
What is the current bug behavior?
The test failed randomly.
What is the expected correct behavior?
The test pass.
Relevant logs and/or screenshots
......F.......................................
AppConfigTest.cpp:346:Assertion
Test name: fwServices::ut::AppConfigTest::startStopTest
assertion failed
- Expression: gnsrv5 == nullptr
Failures !!!
Run: 45 Failure total: 1 Failures: 1 Errors: 0
Possible fixes
It is possible to increase the time in fwTestWaitMacro
BUT the problem is certainly in the AppConfigManager.
When managing the deferred objects, the service are created/started/stropped/destroyed. The objects come from signals and maybe it is not totally thread safe.
We need to refactor AppConfigManager
It is possible to use the AppManager
class in AppConfigManager
to mutualize the service management. Be careful that it may change the behaviour of the applications : AppManager does not destroy the service when all the object are not present, it only stops the services.