tst_qnetworkreply: localhost may resolve to ipv4 and 6
On some platforms, localhost resolves to both ipv4 and ipv6 addresses. In that case we might get multiple emissions of the socketStartedConnecting signal, for Happy Eyeballs. Pick-to: 6.7 6.5 Change-Id: Ib39a167bdde2089106c89a3e297cbb0ad2f357d9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 13a0f294b5ef2ec8a2057d72365f989ddf6290de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
7eea3acac9
commit
6e98673846
@ -10165,7 +10165,14 @@ void tst_QNetworkReply::moreActivitySignals()
|
||||
QSignalSpy spy3(reply.data(), SIGNAL(metaDataChanged()));
|
||||
QSignalSpy spy4(reply.data(), SIGNAL(finished()));
|
||||
spy1.wait();
|
||||
if (url.host() == u"localhost") {
|
||||
// localhost may resolve to both v4 and v6, so we may get two
|
||||
// socketStartedConnecting signals
|
||||
QCOMPARE_GE(spy1.size(), 1);
|
||||
QCOMPARE_LE(spy1.size(), 2);
|
||||
} else {
|
||||
QCOMPARE(spy1.size(), 1);
|
||||
}
|
||||
spy2.wait();
|
||||
QCOMPARE(spy2.size(), 1);
|
||||
spy3.wait();
|
||||
|
Loading…
x
Reference in New Issue
Block a user