Change the epicsTimerTest delayVerify failure condition
This test verifies timer delays between 1.0 and 3.4 seconds. A test failure now means the measured delay was more than 0.25 seconds different than the request, instead of being 5% of the request. This should now pass on GHA macOS. On the 7.0 branch it should call testImpreciseTiming() and use a smaller absolute delay threshold for better targets.
This commit is contained in:
@@ -108,13 +108,14 @@ inline double delayVerify::delay () const
|
||||
|
||||
double delayVerify::checkError () const
|
||||
{
|
||||
const double messageThresh = 5.0; // percent
|
||||
double actualDelay = this->expireStamp - this->beginStamp;
|
||||
double measuredError = actualDelay - this->expectedDelay;
|
||||
double percentError = 100.0 * fabs ( measuredError ) / this->expectedDelay;
|
||||
testOk ( percentError < messageThresh, "%f < %f, delay = %f s, error = %f s (%.1f %%)",
|
||||
percentError, messageThresh,
|
||||
this->expectedDelay, measuredError, percentError );
|
||||
const double minError = 0.25;
|
||||
double measuredDelay = this->expireStamp - this->beginStamp;
|
||||
double measuredError = measuredDelay - this->expectedDelay;
|
||||
double absoluteError = fabs(measuredError);
|
||||
double percentError = 100.0 * measuredError / this->expectedDelay;
|
||||
testOk(absoluteError < minError,
|
||||
"Delay %.3f s, error = %+.6f ms (%+.3f %%)",
|
||||
this->expectedDelay, measuredError * 1000, percentError);
|
||||
return measuredError;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user