ChimeraTK / ApplicationCore

Core library for creating applications based on the ControlSystemAdapter and DeviceAccess.
GNU Lesser General Public License v3.0
1 stars 2 forks source link

TestFaclility does not start main loop in runApplication() #66

Closed killenb closed 5 years ago

killenb commented 5 years ago

The TestFacility does not start the main loops of the modules in all cases in runApplication(). The main loop is eventually started in the first stepApplication(). I created a test which reproduces this isse (testTestFacility2.cc). Under Ubuntu16.04 it works if I add a Device which connected to the CS, triggered by a PeriodicTrigger. However, this fails under Ubuntu 18.04

I think it's an issue in the testable mode, that it returns the lock too early to the test facility.

killenb commented 5 years ago

I removed the urgent flag because I found a workaround:

SumLimiterTestApp theTestApp;
ChimeraTK::TestFacility testFacility;

// we want to test that the initial values are processed in the beginning of the main loop,
// without any interaction with the module
testFacility.writeScalar<double>("/VoltageLimiter/acVoltageSetpoint",25.);
testFacility.writeScalar<double>("/VoltageLimiter/dcVoltageSetpoint",10.);
testFacility.runApplication();

// workaround for bug in test facility: Write to some bogous variable which has nothing to do with the app,
// so we can execute the first stepApplication which will start all main loops.
testFacility.writeScalar<int>("writeMe",42);
testFacility.stepApplication();