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.8 6.7 6.5 Change-Id: Ib39a167bdde2089106c89a3e297cbb0ad2f357d9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
e02813eeb5
commit
13a0f294b5
@ -10164,7 +10164,14 @@ void tst_QNetworkReply::moreActivitySignals()
|
||||
QSignalSpy spy3(reply.data(), SIGNAL(metaDataChanged()));
|
||||
QSignalSpy spy4(reply.data(), SIGNAL(finished()));
|
||||
spy1.wait();
|
||||
QCOMPARE(spy1.size(), 1);
|
||||
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