From f3898fe2cc3fe1ab96b4f0274a3252720b74c835 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Fri, 17 Apr 2015 14:17:26 +0200 Subject: [PATCH] tst_qnetworkreply::ioGetFromBuiltinHttp - fix blacklisted test (OS X) This test fails on OS X: we first fill sockets' kernel buffers and then we tryto write a 'residue', waiting in 'select' for 2 seconds. It looks like on OS X (at least, 10.10) 2 seconds are not enough - we always have a timeout. Wait ... 4 seconds. Change-Id: Id679dccda10b8f7859b8dfa6456b91ec13d52f68 Reviewed-by: Richard J. Moore --- tests/auto/network/access/qnetworkreply/BLACKLIST | 2 -- .../network/access/qnetworkreply/tst_qnetworkreply.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/auto/network/access/qnetworkreply/BLACKLIST b/tests/auto/network/access/qnetworkreply/BLACKLIST index 7c9b8db3c3..5012b356c2 100644 --- a/tests/auto/network/access/qnetworkreply/BLACKLIST +++ b/tests/auto/network/access/qnetworkreply/BLACKLIST @@ -1,9 +1,7 @@ osx [ioGetFromBuiltinHttp:http+limited] -osx ubuntu-14.04 [ioGetFromBuiltinHttp:https+limited] -osx ubuntu-14.04 [ioGetFromHttpBrokenServer:no-newline] osx diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 4d41d4beb1..b448a1db12 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -1078,7 +1078,11 @@ protected: // clean up QAbstractSocket's residue: while (client->bytesToWrite() > 0) { qDebug() << "Still having" << client->bytesToWrite() << "bytes to write, doing that now"; +#ifdef Q_OS_OSX + if (!client->waitForBytesWritten(4000)) { +#else if (!client->waitForBytesWritten(2000)) { +#endif qDebug() << "ERROR: FastSender:" << client->error() << "cleaning up residue"; return; } @@ -1098,7 +1102,11 @@ protected: measuredSentBytes += writeNextData(client, bytesToWrite); while (client->bytesToWrite() > 0) { +#ifdef Q_OS_OSX + if (!client->waitForBytesWritten(4000)) { +#else if (!client->waitForBytesWritten(2000)) { +#endif qDebug() << "ERROR: FastSender:" << client->error() << "during blocking write"; return; }