mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 08:31:43 +02:00
Internet connection is not available on build servers, making tests fail #1365
This commit is contained in:
@@ -102,7 +102,7 @@ void SocketReactor::run()
|
|||||||
if (nSockets == 0)
|
if (nSockets == 0)
|
||||||
{
|
{
|
||||||
onIdle();
|
onIdle();
|
||||||
Thread::trySleep(_timeout.totalMilliseconds());
|
Thread::trySleep(static_cast<long>(_timeout.totalMilliseconds()));
|
||||||
}
|
}
|
||||||
else if (Socket::select(readable, writable, except, _timeout))
|
else if (Socket::select(readable, writable, except, _timeout))
|
||||||
{
|
{
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#include "Poco/Net/NTPEventArgs.h"
|
#include "Poco/Net/NTPEventArgs.h"
|
||||||
#include "Poco/Net/SocketAddress.h"
|
#include "Poco/Net/SocketAddress.h"
|
||||||
#include "Poco/Net/NetException.h"
|
#include "Poco/Net/NetException.h"
|
||||||
|
#include "Poco/Net/ICMPClient.h"
|
||||||
#include "Poco/AutoPtr.h"
|
#include "Poco/AutoPtr.h"
|
||||||
#include "Poco/Delegate.h"
|
#include "Poco/Delegate.h"
|
||||||
#include "Poco/DateTimeFormatter.h"
|
#include "Poco/DateTimeFormatter.h"
|
||||||
@@ -27,6 +28,7 @@ using Poco::Net::NTPClient;
|
|||||||
using Poco::Net::NTPEventArgs;
|
using Poco::Net::NTPEventArgs;
|
||||||
using Poco::Net::SocketAddress;
|
using Poco::Net::SocketAddress;
|
||||||
using Poco::Net::IPAddress;
|
using Poco::Net::IPAddress;
|
||||||
|
using Poco::Net::ICMPClient;
|
||||||
using Poco::Net::HostNotFoundException;
|
using Poco::Net::HostNotFoundException;
|
||||||
using Poco::Delegate;
|
using Poco::Delegate;
|
||||||
using Poco::AutoPtr;
|
using Poco::AutoPtr;
|
||||||
@@ -46,6 +48,11 @@ NTPClientTest::~NTPClientTest()
|
|||||||
|
|
||||||
void NTPClientTest::testTimeSync()
|
void NTPClientTest::testTimeSync()
|
||||||
{
|
{
|
||||||
|
if (ICMPClient::pingIPv4("pool.ntp.org") <= 0)
|
||||||
|
{
|
||||||
|
std::cerr << "pool.ntp.org not accessibe, test skipped" << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
assert(_ntpClient.request("pool.ntp.org") > 0);
|
assert(_ntpClient.request("pool.ntp.org") > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user