Module: wine
Branch: master
Commit: 3d02e9870a3cae7b0cbb339d37dbed0749c8441a
URL: https://gitlab.winehq.org/wine/wine/-/commit/3d02e9870a3cae7b0cbb339d37dbed…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Fri Jul 21 20:02:16 2023 -0500
httpapi/tests: Do not test that a local TCP port is closed.
I suspect the intent of this test was to verify that httpapi really doesn't bind
to that port. That HttpAddUrlToUrlGroup() fails implies this, but paranoia in a
case like this is rarely unwarranted.
However, this test cannot reliably succeed; some other operating system
component may open a TCP port in the meantime, and it appears that on Windows 10
this does in fact happen.
Since the goal of the test is just extra paranoia, I don't think it's worth
keeping.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55127
---
dlls/httpapi/tests/httpapi.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/dlls/httpapi/tests/httpapi.c b/dlls/httpapi/tests/httpapi.c
index fa412b1093a..9db21635d3a 100644
--- a/dlls/httpapi/tests/httpapi.c
+++ b/dlls/httpapi/tests/httpapi.c
@@ -1384,7 +1384,7 @@ static void test_v2_bound_port(void)
WCHAR url[50];
HANDLE queue, dummy_queue;
int ret;
- SOCKET s, s2;
+ SOCKET s2;
ret = pHttpCreateServerSession(version, &session, 0);
ok(!ret, "Failed to create session, error %u.\n", ret);
@@ -1421,12 +1421,6 @@ static void test_v2_bound_port(void)
ret = pHttpSetUrlGroupProperty(group, HttpServerBindingProperty, &binding, sizeof(binding));
ok(!ret, "Failed to rebind request queue, error %u.\n", ret);
- s = socket(AF_INET, SOCK_STREAM, 0);
- ret = connect(s, (struct sockaddr *)&sockaddr, sizeof(sockaddr));
- ok(ret, "Connecting to socket succeeded, %lu.\n", GetLastError());
- ok(GetLastError() == WSAECONNREFUSED, "Unexpected error connecting to socket, %lu.\n", GetLastError());
-
- closesocket(s);
ret = pHttpCloseRequestQueue(dummy_queue);
ok(!ret, "Failed to close queue handle, error %u.\n", ret);
ret = pHttpCloseRequestQueue(queue);
Module: wine
Branch: master
Commit: 8ab7120badb68519eb3a76ad6768c3109454e2b0
URL: https://gitlab.winehq.org/wine/wine/-/commit/8ab7120badb68519eb3a76ad6768c3…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Sat Jul 22 13:46:55 2023 -0500
ws2_32/tests: Execute test_iocp() near the end.
Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=54413
---
dlls/ws2_32/tests/sock.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index ac104400104..e53d9991e56 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -13877,7 +13877,6 @@ START_TEST( sock )
test_WSARecv();
test_WSAPoll();
test_write_watch();
- test_iocp();
test_events();
@@ -13903,6 +13902,31 @@ START_TEST( sock )
test_connect_udp();
test_tcp_sendto_recvfrom();
+ /* There is apparently an obscure interaction between this test and
+ * test_WSAGetOverlappedResult().
+ *
+ * One thing this test does is to close socket handles through CloseHandle()
+ * and NtClose(), to prove that that is sufficient to cancel I/O on the
+ * socket. This has the obscure side effect that ws2_32.dll's internal
+ * per-process list of sockets never has that socket removed.
+ *
+ * test_WSAGetOverlappedResult() effectively proves that the per-process
+ * list of sockets exists, by calling DuplicateHandle() on a socket and then
+ * passing it to a function which cares about socket handle validity, which
+ * checks that handle against the internal list, finds it invalid, and
+ * returns WSAENOTSOCK.
+ *
+ * The problem is that if we close an NT handle without removing it from the
+ * ws2_32 list, then duplicate another handle, it *may* end up allocated to
+ * the same handle value, and thus re-validate that handle right under the
+ * nose of ws2_32. This causes the test_WSAGetOverlappedResult() test to
+ * sometimes succeed where it's expected to fail with ENOTSOCK.
+ *
+ * In order to avoid this, make sure that this test—which is evidently
+ * destructive to ws2_32 internal state in obscure ways—is executed last.
+ */
+ test_iocp();
+
/* this is an io heavy test, do it at the end so the kernel doesn't start dropping packets */
test_send();
Module: wine
Branch: master
Commit: 9a43d51e06b9f52a4c4feefe8c8ab5aa31d8873f
URL: https://gitlab.winehq.org/wine/wine/-/commit/9a43d51e06b9f52a4c4feefe8c8ab5…
Author: Zebediah Figura <zfigura(a)codeweavers.com>
Date: Fri Jul 21 21:48:16 2023 -0500
ws2_32/tests: Give an event test marked todo a bit more time to fail on Wine.
We are testing that FD_CLOSE isn't generated, but Wine currently generates
FD_CLOSE anyway. However, sometimes Wine does not generate FD_CLOSE immediately,
causing the test to intermittently succeed inside the todo block.
This test is difficult to fix properly—it would involve either (arbitrary?)
buffering in the server, or support from the host OS.
However, we also don't want to make the Windows tests take longer, so add the
200 ms of leeway only on Wine.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54073
---
dlls/ws2_32/tests/sock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 9d0f8e0e820..9881540319b 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -6920,7 +6920,7 @@ static void test_close_events(struct event_test_ctx *ctx)
ret = recv(server, buffer, 5, 0);
ok(ret == 2, "got %d\n", ret);
- check_events_todo(ctx, 0, 0, 0);
+ check_events_todo(ctx, 0, 0, !strcmp(winetest_platform, "wine") ? 200 : 0);
closesocket(server);