tst_qnetworkreply: stabilize and unblacklist getFromHttpIntoBuffer2
The test in general is fine, but it was making an assumption that the first 5 readyRead emissions would never result in the whole message being received. In certain scenarios with slowdown however it was still possible that we would receive the whole message after just a few readyReady emissions. While I didn't check it's most likely due to a mechanic in the QNetworkReply machinery where we suppress some emissions if we know there's more data just about to be available. Task-number: QTBUG-88943 Change-Id: I0cf06edb34d4e86cc8a42c0f1cd7e8c35765f6ee Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
27f52942b4
commit
0592369df4
@ -11,8 +11,6 @@ osx
|
||||
linux
|
||||
[getFromHttpIntoBuffer]
|
||||
osx
|
||||
[getFromHttpIntoBuffer2]
|
||||
windows-10
|
||||
[headFromHttp]
|
||||
windows-10 msvc-2017
|
||||
[ioPostToHttpFromSocket]
|
||||
|
@ -6897,13 +6897,8 @@ public:
|
||||
// bytesAvailable must never be 0
|
||||
QVERIFY(bytesAvailable != 0);
|
||||
|
||||
if (bytesAvailableList.length() < 5) {
|
||||
// We assume that the first few times the bytes available must be less than the complete size, e.g.
|
||||
// the bytesAvailable() function works correctly in case of a downloadBuffer.
|
||||
QVERIFY(bytesAvailable < uploadSize);
|
||||
}
|
||||
if (!bytesAvailableList.isEmpty()) {
|
||||
// Also check that the same bytesAvailable is not coming twice in a row
|
||||
// Check that the same bytesAvailable is not coming twice in a row
|
||||
QVERIFY(bytesAvailableList.last() != bytesAvailable);
|
||||
}
|
||||
|
||||
@ -6915,6 +6910,12 @@ public:
|
||||
{
|
||||
// We should have already received all readyRead
|
||||
QVERIFY(!bytesAvailableList.isEmpty());
|
||||
for (int i = 0; i < std::min(int(bytesAvailableList.size() - 1), 5); ++i) {
|
||||
// We assume that, at least, the first time the bytes available must be less than the
|
||||
// complete size, e.g. the bytesAvailable() function works correctly in case of a
|
||||
// downloadBuffer.
|
||||
QVERIFY(bytesAvailableList.at(i) < uploadSize);
|
||||
}
|
||||
QCOMPARE(bytesAvailableList.last(), uploadSize);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user