Commit 8f80ea67 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntoskrnl/tests: Retry bind if address is in use in test_wsk_listen_socket().

Fixes test failures occuring when the tests using the same ports run closely one after another. Signed-off-by: 's avatarPaul Gofman <pgofman@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 5ead4e1e
...@@ -265,19 +265,25 @@ static void test_wsk_listen_socket(void) ...@@ -265,19 +265,25 @@ static void test_wsk_listen_socket(void)
ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status); ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status);
ok(wsk_irp->IoStatus.Status == STATUS_SUCCESS, "Got unexpected status %#x.\n", wsk_irp->IoStatus.Status); ok(wsk_irp->IoStatus.Status == STATUS_SUCCESS, "Got unexpected status %#x.\n", wsk_irp->IoStatus.Status);
IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL); do
IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE); {
wsk_irp->IoStatus.Status = 0xdeadbeef; IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL);
wsk_irp->IoStatus.Information = 0xdeadbeef; IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE);
status = tcp_dispatch->WskBind(tcp_socket, (SOCKADDR *)&addr, 0, wsk_irp); wsk_irp->IoStatus.Status = 0xdeadbeef;
ok(status == STATUS_PENDING, "Got unexpected status %#x.\n", status); wsk_irp->IoStatus.Information = 0xdeadbeef;
status = KeWaitForSingleObject(&irp_complete_event, Executive, KernelMode, FALSE, NULL); status = tcp_dispatch->WskBind(tcp_socket, (SOCKADDR *)&addr, 0, wsk_irp);
ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status); ok(status == STATUS_PENDING, "Got unexpected status %#x.\n", status);
ok(wsk_irp->IoStatus.Status == STATUS_SUCCESS, "Got unexpected status %#x.\n", wsk_irp->IoStatus.Status); status = KeWaitForSingleObject(&irp_complete_event, Executive, KernelMode, FALSE, NULL);
ok(!wsk_irp->IoStatus.Information, "Got unexpected Information %#lx.\n", ok(status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status);
wsk_irp->IoStatus.Information); ok(wsk_irp->IoStatus.Status == STATUS_SUCCESS
|| wsk_irp->IoStatus.Status == STATUS_ADDRESS_ALREADY_ASSOCIATED,
"Got unexpected status %#x.\n", wsk_irp->IoStatus.Status);
ok(!wsk_irp->IoStatus.Information, "Got unexpected Information %#lx.\n",
wsk_irp->IoStatus.Information);
}
while (wsk_irp->IoStatus.Status == STATUS_ADDRESS_ALREADY_ASSOCIATED);
timeout.QuadPart = -1000 * 10000; timeout.QuadPart = -2000 * 10000;
IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL); IoReuseIrp(wsk_irp, STATUS_UNSUCCESSFUL);
IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE); IoSetCompletionRoutine(wsk_irp, irp_completion_routine, &irp_complete_event, TRUE, TRUE, TRUE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment