http://bugs.winehq.org/show_bug.cgi?id=28712
--- Comment #3 from Hans Leidekker hans@meelstraat.net 2011-10-14 09:09:37 CDT --- (In reply to comment #2)
Looks like it's because the Sleep(2000) is insufficient when running under valgrind. If I comment out the part before the sleep, the error goes away. If I comment out the part after the sleep, the error goes away. If I change it to Sleep(20000), the error goes away.
Is there a more reliable way to wait for the entry to be evicted from the cache?
I believe this is what Microsoft calls "keep-alive pooling of anonymous connections across sessions". I remember looking for an option or registry tweak to disable it but I came up empty.
Unloading winhttp between tests would work around the problem I guess, but it's a bit heavy-handed. Using a different host for each test or using authenticated connections to a single host should also work around it.