Review Request 108380: Fix race condition in KTcpSocketTest

Jon Severinsson jon at severinsson.net
Sun Jan 13 11:54:02 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108380/
-----------------------------------------------------------

(Updated Jan. 13, 2013, 11:54 a.m.)


Review request for KDE Frameworks and kdelibs.


Changes
-------

Drop unnecessary while loop.


Description
-------

In some cases, only part of the first response had arrived when the second
s->write(HTTPREQUEST) was executed. Thus the second s->waitForReadyRead()
would return when the rest of the first response arrived, which in some
cases would be before the second request had left the write buffer
That in turn meant that s->close() would be run with a non-empty write
buffer, thus only putting the socket in ClosingState rather than
UnconnectedState as the test expected.

Only tested on the frameworks branch, but it might be applicable to master as well.


Diffs (updated)
-----

  kdecore/tests/ktcpsockettest.cpp bfc4212 

Diff: http://git.reviewboard.kde.org/r/108380/diff/


Testing
-------

Run the test 100 times in a loop without any failures.


Thanks,

Jon Severinsson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20130113/bc91fea0/attachment.html>


More information about the Kde-frameworks-devel mailing list