Review Request 108380: Fix race condition in KTcpSocketTest

Jon Severinsson jon at
Sun Jan 13 11:54:02 GMT 2013

This is an automatically generated e-mail. To reply, visit:

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

Review request for KDE Frameworks and kdelibs.


Drop unnecessary while loop.


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 



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


Jon Severinsson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
Kde-frameworks-devel mailing list
Kde-frameworks-devel at

More information about the kde-core-devel mailing list