[PATCH] httpapi/tests: Sleep before calling GetOverlappedResult() in test_v2_server().

Zebediah Figura z.figura12 at gmail.com
Wed Dec 16 10:51:49 CST 2020


This seems to be a variation of a bug already encountered; here the kernel does
not report the right value in the IOSB until after completion is signaled.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48587
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/httpapi/tests/httpapi.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/dlls/httpapi/tests/httpapi.c b/dlls/httpapi/tests/httpapi.c
index d758dee6b2c..752d008fc6b 100644
--- a/dlls/httpapi/tests/httpapi.c
+++ b/dlls/httpapi/tests/httpapi.c
@@ -233,9 +233,11 @@ static void test_v1_server(void)
     ok(ret, "Got error %u.\n", GetLastError());
     ok(ret_size > sizeof(*req), "Got size %u.\n", ret_size);
 
-    /* 64-bit Windows 10 version 1507 apparently suffers from a bug where it
-     * will report success before completely filling the buffer. Wait for a
-     * short interval to work around this. */
+    /* Various versions of Windows (observed on 64-bit Windows 8 and Windows 10
+     * version 1507, but probably affecting others) suffer from a bug where the
+     * kernel will report success before completely filling the buffer or
+     * reporting the correct buffer size. Wait for a short interval to work
+     * around this. */
     Sleep(100);
 
     ok(!req->Flags, "Got flags %#x.\n", req->Flags);
@@ -1306,10 +1308,14 @@ static void test_v2_server(void)
     ret = send(s, req_text, strlen(req_text), 0);
     ok(ret == strlen(req_text), "send() returned %d.\n", ret);
 
+    ret = WaitForSingleObject(ovl.hEvent, 100);
+    ok(!ret, "Got %u.\n", ret);
+
+    Sleep(100);
+
     ret = GetOverlappedResult(queue, &ovl, &ret_size, TRUE);
     ok(ret, "Got error %u.\n", GetLastError());
     ok(ret_size > sizeof(*req), "Got size %u.\n", ret_size);
-    Sleep(100);
 
     ok(!req->Flags, "Got flags %#x.\n", req->Flags);
     ok(req->ConnectionId, "Expected nonzero connection ID.\n");
-- 
2.29.2




More information about the wine-devel mailing list