diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2021-07-15 11:19:06 +0300 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2021-07-15 18:06:54 +0300 |
commit | ac40875ba701d2f5d405bbd652fbe699f074236c (patch) | |
tree | 6533e7b297b8f1be8993c4b227640fbb860daf46 /tests/benchmarks/network | |
parent | 2f4868548be8b3821cdbec047892b7d940c04908 (diff) |
QLocalSocket benchmark: improve connectivity and error reporting
For nonblocking Unix domain sockets the connection may not be
completed immediately. So, add a blocking call to waitForConnected()
to improve test stability. Also, explain a possible reason that
cause the connection to fail on Unix.
Task-number: QTBUG-91713
Change-Id: If34070f2383fd0c854e2707c734fe5da4bda1b42
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/benchmarks/network')
-rw-r--r-- | tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 406fe741e0..d7b39ed566 100644 --- a/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -116,6 +116,10 @@ public: }); socket->connectToServer("foo"); + QVERIFY2(socket->waitForConnected(), "The system is probably reaching the maximum " + "number of open file descriptors. On Unix, " + "try to increase the limit with 'ulimit -n 32000' " + "and run the test again."); QCOMPARE(socket->state(), QLocalSocket::ConnectedState); } } |