Propose use of SYNCTHING_TEST_TIMEOUT_FACTOR
This commit is contained in:
parent
9599dcee81
commit
7611ad1c8e
|
@ -505,7 +505,9 @@ void ConnectionTests::testRequestingLog()
|
|||
timeout.start();
|
||||
loop.exec();
|
||||
QObject::disconnect(request); // ensure callback is not called after return (in error case)
|
||||
CPPUNIT_ASSERT_MESSAGE("log entries returned before timeout", callbackOk);
|
||||
CPPUNIT_ASSERT_MESSAGE(
|
||||
argsToString("log entries returned before timeout of ", timeout.interval(), " ms (set SYNCTHING_TEST_TIMEOUT_FACTOR to increase timeout)"),
|
||||
callbackOk);
|
||||
}
|
||||
|
||||
void ConnectionTests::testRequestingQrCode()
|
||||
|
@ -529,7 +531,9 @@ void ConnectionTests::testRequestingQrCode()
|
|||
timeout.start();
|
||||
loop.exec();
|
||||
QObject::disconnect(request); // ensure callback is not called after return (in error case)
|
||||
CPPUNIT_ASSERT_MESSAGE("QR code returned before timeout", callbackOk);
|
||||
CPPUNIT_ASSERT_MESSAGE(
|
||||
argsToString("QR code returned before timeout of ", timeout.interval(), " ms (set SYNCTHING_TEST_TIMEOUT_FACTOR to increase timeout)"),
|
||||
callbackOk);
|
||||
}
|
||||
|
||||
void ConnectionTests::testDisconnecting()
|
||||
|
|
|
@ -367,7 +367,8 @@ bool waitForSignalsOrFail(Action action, int timeout, const SignalInfo &failure,
|
|||
argsToString("Signal(s) ", failedSignalNames(signalInfos...).data(), " has/have not emmitted before ", failure.signalName().data(), '.'));
|
||||
} else if (timeoutFailed) {
|
||||
CPPUNIT_FAIL(argsToString("Signal(s) ", failedSignalNames(signalInfos...).data(), " has/have not emmitted within at least ", timer.interval(),
|
||||
" ms.", timeoutFactor != 1.0 ? argsToString(" (original timeout: ", timeout, " ms)") : std::string()));
|
||||
" ms (set environment variable SYNCTHING_TEST_TIMEOUT_FACTOR to increase the timeout).",
|
||||
timeoutFactor != 1.0 ? argsToString(" (original timeout: ", timeout, " ms)") : std::string()));
|
||||
}
|
||||
#endif
|
||||
return !failureEmitted && !timeoutFailed;
|
||||
|
|
|
@ -36,8 +36,12 @@ void SyncthingTestInstance::start()
|
|||
timeoutFactor = stringToNumber<double>(string(timeoutFactorEnv.data()));
|
||||
cerr << " - Using timeout factor " << timeoutFactor << endl;
|
||||
} catch (const ConversionException &) {
|
||||
cerr << " - Specified SYNCTHING_TEST_TIMEOUT_FACTOR \"" << timeoutFactorEnv.data() << "\" is no valid double and hence ignored" << endl;
|
||||
cerr << " - Specified SYNCTHING_TEST_TIMEOUT_FACTOR \"" << timeoutFactorEnv.data()
|
||||
<< "\" is no valid double and hence ignored\n (defaulting to " << timeoutFactor << ')' << endl;
|
||||
}
|
||||
} else {
|
||||
cerr << " - No timeout factor set, defaulting to " << timeoutFactor
|
||||
<< ("\n (set environment variable SYNCTHING_TEST_TIMEOUT_FACTOR to specify a factor to run tests on a slow machine)") << endl;
|
||||
}
|
||||
|
||||
// setup st config
|
||||
|
|
Loading…
Reference in New Issue