Hi Hans,
Your patch makes the test timeout on my machine (http://test.winehq.org/data/f212579ae9a1b770ebd34cec20f95e1977bb57f0/2000_w2...).
Timeout occurs in HttpSendRequestEx_test on HttpEndRequest call which hang. Disabling test_async_HttpSendRequestEx makes it pass again.
After some tests it seems to be a timing issue, but I haven't been able to find a real solution. Just that waiting at least 500msec between the two HttpEndRequest, or waiting at least 150ms after the WaitForSingleObject that follow the second HttpEndRequest makes test pass. Reading response doesn't change anything.
After reading a little bit about how this works I don't see anything wrong. Perhaps you will.
thanks, Nicolas Le Cam
On Saturday 11 April 2009 05:14:25 Nicolas Le Cam wrote:
Your patch makes the test timeout on my machine (http://test.winehq.org/data/f212579ae9a1b770ebd34cec20f95e1977bb57f0/2000_w2...).
Timeout occurs in HttpSendRequestEx_test on HttpEndRequest call which hang. Disabling test_async_HttpSendRequestEx makes it pass again.
After some tests it seems to be a timing issue, but I haven't been able to find a real solution. Just that waiting at least 500msec between the two HttpEndRequest, or waiting at least 150ms after the WaitForSingleObject that follow the second HttpEndRequest makes test pass. Reading response doesn't change anything.
After reading a little bit about how this works I don't see anything wrong. Perhaps you will.
Windows keeps a cache of connections, so when the second test is executed within the cache timeout it will use the same connection and we will not see certain notifications, such as INTERNET_STATUS_CLOSING_CONNECTION.
I have found that sleeping for 2 seconds is enough to defeat the cache.
-Hans
2009/4/11 Hans Leidekker hans@meelstraat.net:
On Saturday 11 April 2009 05:14:25 Nicolas Le Cam wrote:
Your patch makes the test timeout on my machine (http://test.winehq.org/data/f212579ae9a1b770ebd34cec20f95e1977bb57f0/2000_w2...).
Timeout occurs in HttpSendRequestEx_test on HttpEndRequest call which hang. Disabling test_async_HttpSendRequestEx makes it pass again.
After some tests it seems to be a timing issue, but I haven't been able to find a real solution. Just that waiting at least 500msec between the two HttpEndRequest, or waiting at least 150ms after the WaitForSingleObject that follow the second HttpEndRequest makes test pass. Reading response doesn't change anything.
After reading a little bit about how this works I don't see anything wrong. Perhaps you will.
Windows keeps a cache of connections, so when the second test is executed within the cache timeout it will use the same connection and we will not see certain notifications, such as INTERNET_STATUS_CLOSING_CONNECTION.
I have found that sleeping for 2 seconds is enough to defeat the cache.
-Hans
Is there no way to avoid use of cached connections or to clean the cache before those two tests ? Perhaps moving both tests up and down instead of sleeping at end of them could help.
On Saturday 11 April 2009 15:20:06 Nicolas Le Cam wrote:
Is there no way to avoid use of cached connections or to clean the cache before those two tests ? Perhaps moving both tests up and down instead of sleeping at end of them could help.
I looked for a way to disable it but couldn't find any. Moving the tests around doesn't really help; if the machine and network are fast enough you will still run into this problem.
I thought about merging the tests too, but we want synchronous request in the first and asynchronous requests in the second, and you can't have both within the same session.
A simple workaround would be to host the posttest.php script on a second web server.
-Hans
2009/4/11 Hans Leidekker hans@meelstraat.net:
On Saturday 11 April 2009 15:20:06 Nicolas Le Cam wrote:
Is there no way to avoid use of cached connections or to clean the cache before those two tests ? Perhaps moving both tests up and down instead of sleeping at end of them could help.
I looked for a way to disable it but couldn't find any. Moving the tests around doesn't really help; if the machine and network are fast enough you will still run into this problem.
I thought about merging the tests too, but we want synchronous request in the first and asynchronous requests in the second, and you can't have both within the same session.
A simple workaround would be to host the posttest.php script on a second web server.
-Hans
It seems moving HttpSendRequestEx_test() to be the last one make test pass on my machine, but I don't think sending a patch just for that is worthwhile.
What I don't understand is that my test platform is a virtual one, running on a laptop, so shouldn't be that fast, and (according to test.winehq.org) it seems to be the only platform where it occurs (other platforms timing out were already doing that before your patch).
Last thing that I don't understand is that it hangs on HttpEndRequest in HttpSendRequestEx_test(), like if server wasn't answering the second query. Where it works multiple times for test.winehq.org.
Anyway I will let this one as is, as I can't see a real solution except moving one of the test to another php script or host posttest.php script on two different servers.
Thanks for your answers