summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2012-11-02 12:25:58 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-02 15:59:57 +0100
commit000025ca1ecabe363934bdc8794b01ffb926af66 (patch)
tree58f720746c1379bc0b191847663d1af630b618cb /tests/auto
parentb2189acfc142397e8f3f547b0affdfc0b233fbb2 (diff)
speed up tst_QLocalSocket::readBufferOverflow
Ifdef out waitForBytesWritten on Windows. See comment in source. Change-Id: I7a2268d2634c2524cd8291c72dd9708e430e314e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index 4f6fc4619f..ed00d7db88 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -555,7 +555,16 @@ void tst_QLocalSocket::readBufferOverflow()
char buffer[dataBufferSize];
memset(buffer, 0, dataBufferSize);
serverSocket->write(buffer, dataBufferSize);
+#ifndef Q_OS_WIN
+ // The data is not immediately sent, but buffered.
+ // On Windows, the flushing is done asynchronously by a separate thread.
+ // However, this operation will never complete as long as the data is not
+ // read by the other end, so the call below always times out.
+ // On Unix, the flushing is synchronous and thus needs to be done before
+ // attempting to read the data in the same thread. Buffering by the OS
+ // prevents the deadlock seen on Windows.
serverSocket->waitForBytesWritten();
+#endif
// wait until the first 128 bytes are ready to read
QVERIFY(client.waitForReadyRead());